From 3964c2ea8b3bd44c646a426c8017194eb01cfb56 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Fri, 13 Mar 2026 19:29:32 -0700 Subject: [PATCH 1/4] ci: add acceptance test workflow triggered after releases --- .github/workflows/acceptance-test.yml | 105 ++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/acceptance-test.yml diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml new file mode 100644 index 0000000000..5d18ba84a5 --- /dev/null +++ b/.github/workflows/acceptance-test.yml @@ -0,0 +1,105 @@ +name: Acceptance Test + +on: + workflow_run: + workflows: ["Release Dev", "Release Tag"] + types: [completed] + +permissions: + contents: read + packages: read + +defaults: + run: + shell: bash + +jobs: + acceptance: + name: Acceptance (${{ matrix.arch }}) + if: ${{ github.event.workflow_run.conclusion == 'success' }} + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + runner: build-amd64 + target: x86_64-unknown-linux-musl + - arch: arm64 + runner: build-arm64 + target: aarch64-unknown-linux-musl + runs-on: ${{ matrix.runner }} + timeout-minutes: 30 + container: + image: ghcr.io/nvidia/openshell/ci:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + options: --privileged + volumes: + - /var/run/docker.sock:/var/run/docker.sock + env: + OPENSHELL_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - name: Determine release tag + id: release + run: | + set -euo pipefail + WORKFLOW_NAME="${{ github.event.workflow_run.name }}" + if [ "$WORKFLOW_NAME" = "Release Dev" ]; then + echo "tag=devel" >> "$GITHUB_OUTPUT" + elif [ "$WORKFLOW_NAME" = "Release Tag" ]; then + # Extract the tag from the head branch (e.g. v1.2.3) + TAG="${{ github.event.workflow_run.head_branch }}" + if [ -z "$TAG" ]; then + echo "::error::Could not determine release tag from workflow_run" + exit 1 + fi + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + else + echo "::error::Unexpected triggering workflow: ${WORKFLOW_NAME}" + exit 1 + fi + + - name: Install CLI from GitHub Release + run: | + set -euo pipefail + TAG="${{ steps.release.outputs.tag }}" + ASSET="openshell-${{ matrix.target }}.tar.gz" + + echo "Downloading ${ASSET} from release ${TAG}..." + gh release download "${TAG}" \ + --repo "${{ github.repository }}" \ + --pattern "${ASSET}" \ + --output "/tmp/${ASSET}" + + tar -xzf "/tmp/${ASSET}" -C /tmp + install -m 755 /tmp/openshell /usr/local/bin/openshell + rm -f "/tmp/${ASSET}" /tmp/openshell + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Verify CLI installation + run: openshell --version + + - name: Run acceptance test + run: | + set -euo pipefail + + echo "Creating sandbox and running 'echo hello world'..." + OUTPUT=$(openshell sandbox create --no-keep --no-tty -- echo "hello world" 2>&1) || { + EXIT_CODE=$? + echo "::error::openshell sandbox create failed with exit code ${EXIT_CODE}" + echo "$OUTPUT" + exit $EXIT_CODE + } + + echo "$OUTPUT" + + if echo "$OUTPUT" | grep -q "hello world"; then + echo "Acceptance test passed: 'hello world' found in output" + else + echo "::error::Acceptance test failed: 'hello world' not found in output" + exit 1 + fi From 3adc179835936dea06a75304427adaa11611913b Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Fri, 13 Mar 2026 19:36:15 -0700 Subject: [PATCH 2/4] ci(acceptance): add workflow_dispatch for manual trigger with release type and ref --- .github/workflows/acceptance-test.yml | 48 +++++++++++++++++++-------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 5d18ba84a5..c9b202ae0e 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -1,6 +1,19 @@ name: Acceptance Test on: + workflow_dispatch: + inputs: + release_type: + description: "Release type to test against" + required: true + type: choice + options: + - dev + - tag + ref: + description: "Tag (e.g. v1.2.3) or commit SHA for the release to test" + required: true + type: string workflow_run: workflows: ["Release Dev", "Release Tag"] types: [completed] @@ -16,7 +29,7 @@ defaults: jobs: acceptance: name: Acceptance (${{ matrix.arch }}) - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} strategy: fail-fast: false matrix: @@ -46,20 +59,29 @@ jobs: id: release run: | set -euo pipefail - WORKFLOW_NAME="${{ github.event.workflow_run.name }}" - if [ "$WORKFLOW_NAME" = "Release Dev" ]; then - echo "tag=devel" >> "$GITHUB_OUTPUT" - elif [ "$WORKFLOW_NAME" = "Release Tag" ]; then - # Extract the tag from the head branch (e.g. v1.2.3) - TAG="${{ github.event.workflow_run.head_branch }}" - if [ -z "$TAG" ]; then - echo "::error::Could not determine release tag from workflow_run" - exit 1 + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + RELEASE_TYPE="${{ inputs.release_type }}" + REF="${{ inputs.ref }}" + if [ "$RELEASE_TYPE" = "dev" ]; then + echo "tag=devel" >> "$GITHUB_OUTPUT" + else + echo "tag=${REF}" >> "$GITHUB_OUTPUT" fi - echo "tag=${TAG}" >> "$GITHUB_OUTPUT" else - echo "::error::Unexpected triggering workflow: ${WORKFLOW_NAME}" - exit 1 + WORKFLOW_NAME="${{ github.event.workflow_run.name }}" + if [ "$WORKFLOW_NAME" = "Release Dev" ]; then + echo "tag=devel" >> "$GITHUB_OUTPUT" + elif [ "$WORKFLOW_NAME" = "Release Tag" ]; then + TAG="${{ github.event.workflow_run.head_branch }}" + if [ -z "$TAG" ]; then + echo "::error::Could not determine release tag from workflow_run" + exit 1 + fi + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + else + echo "::error::Unexpected triggering workflow: ${WORKFLOW_NAME}" + exit 1 + fi fi - name: Install CLI from GitHub Release From 75815aff3563525665a8f08d61855a73e2c7267e Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Fri, 13 Mar 2026 19:57:46 -0700 Subject: [PATCH 3/4] ci(acceptance): simplify manual trigger to single tag input --- .github/workflows/acceptance-test.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index c9b202ae0e..6b45e1864e 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -3,15 +3,8 @@ name: Acceptance Test on: workflow_dispatch: inputs: - release_type: - description: "Release type to test against" - required: true - type: choice - options: - - dev - - tag - ref: - description: "Tag (e.g. v1.2.3) or commit SHA for the release to test" + tag: + description: "Release tag to test (e.g. devel, v1.2.3)" required: true type: string workflow_run: @@ -60,13 +53,7 @@ jobs: run: | set -euo pipefail if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - RELEASE_TYPE="${{ inputs.release_type }}" - REF="${{ inputs.ref }}" - if [ "$RELEASE_TYPE" = "dev" ]; then - echo "tag=devel" >> "$GITHUB_OUTPUT" - else - echo "tag=${REF}" >> "$GITHUB_OUTPUT" - fi + echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" else WORKFLOW_NAME="${{ github.event.workflow_run.name }}" if [ "$WORKFLOW_NAME" = "Release Dev" ]; then From ac31f4d94335dd9b42ed3cd95d7a427feea56740 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Fri, 13 Mar 2026 20:11:43 -0700 Subject: [PATCH 4/4] ci(canary): rename acceptance test to release canary --- .../{acceptance-test.yml => release-canary.yml} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{acceptance-test.yml => release-canary.yml} (92%) diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/release-canary.yml similarity index 92% rename from .github/workflows/acceptance-test.yml rename to .github/workflows/release-canary.yml index 6b45e1864e..91f00ba53b 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/release-canary.yml @@ -1,4 +1,4 @@ -name: Acceptance Test +name: Release Canary on: workflow_dispatch: @@ -21,7 +21,7 @@ defaults: jobs: acceptance: - name: Acceptance (${{ matrix.arch }}) + name: Canary (${{ matrix.arch }}) if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} strategy: fail-fast: false @@ -92,7 +92,7 @@ jobs: - name: Verify CLI installation run: openshell --version - - name: Run acceptance test + - name: Run canary test run: | set -euo pipefail @@ -107,8 +107,8 @@ jobs: echo "$OUTPUT" if echo "$OUTPUT" | grep -q "hello world"; then - echo "Acceptance test passed: 'hello world' found in output" + echo "Canary test passed: 'hello world' found in output" else - echo "::error::Acceptance test failed: 'hello world' not found in output" + echo "::error::Canary test failed: 'hello world' not found in output" exit 1 fi