Skip to content

Commit

Permalink
Merge branch 'mitchell/pre-publish' into mitchell/dx-2334-2
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Dec 14, 2023
2 parents d5d0ef7 + a99f200 commit 122f529
Show file tree
Hide file tree
Showing 941 changed files with 87,210 additions and 30,053 deletions.
8 changes: 0 additions & 8 deletions .github/deps/LICENSE-packr.txt

This file was deleted.

Empty file.
Binary file removed .github/deps/Linux/bin/packr
Binary file not shown.
Binary file removed .github/deps/Linux/bin/state
Binary file not shown.
Binary file removed .github/deps/Linux/bin/state-svc
Binary file not shown.
Binary file removed .github/deps/Linux/bin/upx
Binary file not shown.
Empty file.
Binary file removed .github/deps/Windows/bin/packr.exe
Binary file not shown.
Binary file removed .github/deps/Windows/bin/state-svc.exe
Binary file not shown.
Binary file removed .github/deps/Windows/bin/state.exe
Binary file not shown.
Binary file removed .github/deps/Windows/bin/upx.exe
Binary file not shown.
Empty file.
Binary file removed .github/deps/macOS/bin/packr
Binary file not shown.
Binary file removed .github/deps/macOS/bin/state
Binary file not shown.
Binary file removed .github/deps/macOS/bin/state-svc
Binary file not shown.
Binary file removed .github/deps/macOS/bin/upx
Binary file not shown.
69 changes: 33 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ name: Build-Test-Deploy
- synchronize
- reopened
schedule:
-
cron: 0 0 * * *
- cron: 0 0 * * *

# === Workflow Permissions ===
permissions:
Expand All @@ -25,36 +24,42 @@ permissions:

# === Workflow-level environment variables ===
env:
AWS_REGION : us-east-1
AWS_REGION: us-east-1
AWS_ROLE_SESSION_NAME: gha-activestate-cli

# === JOBS ===
jobs:

# === OS Specific Job (runs on each OS) ===
os_specific:
name: ${{ matrix.platform }}
name: ${{ matrix.sys.os }}
timeout-minutes: 90
strategy:
matrix:
go-version:
- 1.20.x
platform:
- ubuntu-20.04
- macos-11
- windows-2019
sys:
- {os: ubuntu-20.04}
- {os: macos-11, shell: zsh}
- {os: windows-2019}
fail-fast: false
runs-on: ${{ matrix.platform }}
runs-on: ${{ matrix.sys.os }}
env:
ACTIVESTATE_CI: true
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.ref }}-${{ github.event_name }}-${{ matrix.platform }}
group: ${{ github.ref }}-${{ github.event_name }}-${{ matrix.sys.os }}
cancel-in-progress: true

# === OS Specific Steps ===
steps:
- # === Disable Windows Defender as it slows things down significantly ===
name: Disabling Windows Defender
if: runner.os == 'Windows'
shell: powershell
run: Set-MpPreference -DisableRealtimeMonitoring $true

- # === Checkout Code ===
name: Checkout code
Expand All @@ -72,6 +77,10 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- # === Install State Tool ===
name: Install State Tool
uses: ActiveState/setup-state-tool@v1

- # === Setup ===
name: Setup
shell: bash
Expand Down Expand Up @@ -103,11 +112,6 @@ jobs:
run: brew install fish
if: runner.os == 'macOS'

- # === Install Deps ===
name: Install Deps
shell: bash
run: state run install-deps

- # === Preprocess ===
name: Preprocess
shell: bash
Expand Down Expand Up @@ -242,7 +246,7 @@ jobs:
name: Generate Remote Install Deployment
shell: bash
run: state run generate-remote-install-deployment

- # === Configure AWS credentials ==
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down Expand Up @@ -313,15 +317,13 @@ jobs:
echo "Running integration tests with tags: $TEST_SUITE_TAGS (empty means every test not specifically tagged)"
export TEST_SUITE_TAGS="$TEST_SUITE_TAGS"
TIMEOUT=15m
TIMEOUT=30m
if [[ "$TEST_SUITE_TAGS" == "all" ]]; then
TIMEOUT=60m
fi
SHELL='' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` -json 2>&1 | gotestfmt -hide empty-packages
SHELL='${{ matrix.sys.shell }}' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` -json 2>&1 | gotestfmt -hide empty-packages
continue-on-error: ${{ github.event_name == 'schedule' }}
env:
ACTIVESTATE_VERBOSE: true
ACTIVESTATE_DEBUG_SERVICE_REQUESTS: true
INTEGRATION_TEST_USERNAME: ${{ secrets.INTEGRATION_TEST_USERNAME }}
INTEGRATION_TEST_PASSWORD: ${{ secrets.INTEGRATION_TEST_PASSWORD }}
INTEGRATION_TEST_TOKEN: ${{ secrets.INTEGRATION_TEST_TOKEN }}
Expand Down Expand Up @@ -360,7 +362,7 @@ jobs:
"type": "section",
"text": {
"type": "plain_text",
"text": "Select the '${{ matrix.platform }}' job and expand 'Integration Tests' to inspect the failures."
"text": "Select the '${{ matrix.sys.os }}' job and expand 'Integration Tests' to inspect the failures."
}
}
]
Expand All @@ -379,7 +381,7 @@ jobs:
name: Upload Session Artifacts
uses: actions/upload-artifact@v2
with:
name: session-build-${{ matrix.platform }}
name: session-build-${{ matrix.sys.os }}
path: build/

# === Deploy job (runs once with combined artifacts from OS specific job) ===
Expand All @@ -389,6 +391,7 @@ jobs:
- os_specific
runs-on: ubuntu-20.04
env:
ACTIVESTATE_CI: true
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -408,15 +411,9 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- # === Setup ===
name: Setup
shell: bash
run: |
bin=$(pwd)/.github/deps/${{ runner.os }}/bin
echo "Adding $bin to PATH"
echo "$bin" >> $GITHUB_PATH
ls -ahl $bin
printenv
- # === Install State Tool ===
name: Install State Tool
uses: ActiveState/setup-state-tool@v1

- # === Download All Build Session Artifacts ===
name: Download All Build Session Artifacts
Expand All @@ -433,11 +430,6 @@ jobs:
find . -mindepth 2 -maxdepth 2 -print0 | xargs -0 -I file rsync -av file .
rm -Rf session*
- # === Install Deps ===
name: Install Deps
shell: bash
run: state run install-deps

- # === Preprocess ===
name: Preprocess
shell: bash
Expand All @@ -457,6 +449,11 @@ jobs:
aws-region: ${{ env.AWS_REGION }}
mask-aws-account-id: true

- # === Generate updated master versions.json if necessary ===
name: Generate version list
shell: bash
run: state run generate-versions-list

- # === Deploy ===
name: Deploy
shell: bash
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/propagate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ jobs:
propagate:
name: Propagate to affected version branches
runs-on: ubuntu-20.04
strategy:
matrix:
go-version:
- 1.20.x
env:
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
ACTIVESTATE_CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_USERNAME: ${{ secrets.JIRA_EMAIL }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
Expand All @@ -39,24 +34,20 @@ jobs:
name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
go-version: '1.20.x'

- # === Install State Tool ===
name: Install State Tool
uses: ActiveState/setup-state-tool@v1

- # === Setup ===
name: Setup
shell: bash
run: |
bin=$(pwd)/.github/deps/${{ runner.os }}/bin
echo "Adding $bin to PATH"
echo "$bin" >> $GITHUB_PATH
# We specify our custom user because we need privileges to push to protected branches
git config user.name "AS-builds"
git config user.email "[email protected]"
- # === Install Deps ===
name: Install Deps
shell: bash
run: state run install-deps

- # === Preprocess ===
name: Preprocess
shell: bash
Expand Down Expand Up @@ -84,6 +75,13 @@ jobs:
"type": "mrkdwn",
"text": "Propagate-PR failed for *<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>*\nFailure should be addressed by *${{ github.event.pull_request.user.login }}*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Failed job: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
Expand Down
32 changes: 6 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ jobs:
if: github.event.ref_type == 'tag' && contains(github.event.ref, 'release/remote-installer')
permissions:
id-token: write # This is required for requesting the JWT
strategy:
matrix:
go-version:
- 1.20.x
env:
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
ACTIVESTATE_CI: true
GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION : "us-east-1"
AWS_ROLE_SESSION_NAME: "gha-activestate-cli"
Expand All @@ -36,26 +31,11 @@ jobs:
name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
go-version: '1.20.x'

- # === Setup ===
name: Setup
shell: bash
run: |
bin=$(pwd)/.github/deps/${{ runner.os }}/bin
echo "Adding $bin to PATH"
echo "$bin" >> $GITHUB_PATH
- # === Setup Windows ===
name: Setup (Windows)
shell: pwsh
run: |
echo "${PSScriptRoot}/.github/deps/${{ runner.os }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- # === Install Deps ===
name: Install Deps
shell: bash
run: state run install-deps
- # === Install State Tool ===
name: Install State Tool
uses: ActiveState/setup-state-tool@v1

- # === Preprocess ===
name: Preprocess
Expand Down Expand Up @@ -83,7 +63,7 @@ jobs:
env:
CODE_SIGNING_PASSWD: ${{ secrets.CODE_SIGNING_PASSWD }}
MSI_CERT_BASE64: ${{ secrets.MSI_CERT_BASE64 }}

- # === Configure AWS credentials ==
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
name: Target & Verify PR
runs-on: ubuntu-20.04
env:
ACTIVESTATE_CLI_DISABLE_RUNTIME: true
SHELL: bash
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_USERNAME: ${{ secrets.JIRA_EMAIL }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
Expand All @@ -38,20 +36,9 @@ jobs:
with:
go-version: '1.20.x'

- # === Setup ===
name: Setup
shell: bash
run: |
bin=$(pwd)/.github/deps/${{ runner.os }}/bin
echo "Adding $bin to PATH"
echo "$bin" >> $GITHUB_PATH
ls -ahl $bin
printenv
- # === Install Deps ===
name: Install Deps
shell: bash
run: state run install-deps
- # === Install State Tool ===
name: Install State Tool
uses: ActiveState/setup-state-tool@v1

- # === Preprocess ===
name: Preprocess
Expand All @@ -60,6 +47,7 @@ jobs:

- # === Set Target PR & FixVersion ===
name: Set Target PR and FixVersion
if: github.event.action == 'opened' || github.event.action == 'reopened'
shell: bash
run: go run scripts/ci/target-version-pr/main.go ${{ github.event.pull_request.number }}

Expand Down
22 changes: 15 additions & 7 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ run:
linters-settings:
errcheck:
exclude-functions:
- (*github.com/ActiveState/termtest.ConsoleProcess).Expect
- (*github.com/ActiveState/termtest.ConsoleProcess).ExpectExitCode
- (*github.com/ActiveState/termtest.ConsoleProcess).ExpectNotExitCode
- (*github.com/ActiveState/termtest.ConsoleProcess).ExpectRe
- (*github.com/ActiveState/termtest.ConsoleProcess).ExpectLongString
- (*github.com/ActiveState/termtest.ConsoleProcess).WaitForInput
- (*github.com/ActiveState/termtest.TermTest).Expect
- (*github.com/ActiveState/termtest.TermTest).ExpectExitCode
- (*github.com/ActiveState/termtest.TermTest).ExpectNotExitCode
- (*github.com/ActiveState/termtest.TermTest).ExpectRe
- (*github.com/ActiveState/termtest.TermTest).Expect
- (*github.com/ActiveState/termtest.TermTest).WaitForInput
- (*github.com/ActiveState/termtest.TermTest).SendLine
- (*github.com/ActiveState/termtest.TermTest).ExpectInput
- (*github.com/ActiveState/termtest.TermTest).Wait
- (*github.com/ActiveState/logging.fileHandler).Printf
- (*github.com/ActiveState/logging.standardHandler).Printf
govet:
disable:
- composites

# When issues occur with linting us the snippet below to help with debugging
# linters:
Expand All @@ -23,4 +31,4 @@ linters-settings:
# - ineffassign
# - staticcheck
# - typecheck
# - unused
# - unused
Loading

0 comments on commit 122f529

Please sign in to comment.