Repository navigation
ci(release): smoke test the published image after each release #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| name: Smoke test | ||
|
|
||
| # Runs the integration suite against a published Proxy image instead of one built from source. | ||
| # `release.yml` calls it after a release's image is published. | ||
| # A pull request that changes this workflow runs it against the `latest` published image. | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: Published image version to test, such as 3.1.1 | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| CS_VAULT_CLIENT_ID: | ||
| required: true | ||
| CS_VAULT_CLIENT_KEY: | ||
| required: true | ||
| CS_VAULT_CLIENT_ACCESS_KEY: | ||
| required: true | ||
| CS_VAULT_WORKSPACE_CRN: | ||
| required: true | ||
| SLACK_NOTIFICATION_WEBHOOK_URL: | ||
| required: false | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/smoke-test.yml' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor The path filter lists only this file. A change to the Sources: code-review, mattpocock-skills:code-review · claude-opus-5-5 Generated by Claude Code |
||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| smoke-test: | ||
| name: Smoke test cipherstash/proxy:${{ inputs.version || 'latest' }} (PostgreSQL ${{ matrix.pg_version }}) | ||
| runs-on: blacksmith-16vcpu-ubuntu-2204 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor Only the amd64 image is smoke tested: this runner is x86_64, and both pulls omit Sources: code-review, mattpocock-skills:code-review · claude-opus-5-5 Generated by Claude Code |
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| pg_version: [14, 15, 16, 17] # PG 18 not currently supported | ||
| env: | ||
| PG_VERSION: ${{ matrix.pg_version }} | ||
| PROXY_IMAGE: cipherstash/proxy:${{ inputs.version || 'latest' }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. major On Sources: code-review, mattpocock-skills:code-review · claude-opus-5-5 Generated by Claude Code |
||
| CS_ZEROKMS_HOST: https://us-east-1.aws.zerokms.cipherstashmanaged.net | ||
| CS_CTS_HOST: https://ap-southeast-2.aws.cts.cipherstashmanaged.net | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: ./.github/actions/setup-test | ||
|
|
||
| - name: Decrypt secrets | ||
| uses: cipherstash/secrets-action@main | ||
| with: | ||
| secrets-file: .github/secrets.env.encrypted | ||
| env: | ||
| CS_CLIENT_ID: ${{ secrets.CS_VAULT_CLIENT_ID }} | ||
| CS_CLIENT_KEY: ${{ secrets.CS_VAULT_CLIENT_KEY }} | ||
| CS_CLIENT_ACCESS_KEY: ${{ secrets.CS_VAULT_CLIENT_ACCESS_KEY }} | ||
| CS_WORKSPACE_CRN: ${{ secrets.CS_VAULT_WORKSPACE_CRN }} | ||
|
|
||
| - name: Show the image under test | ||
| run: | | ||
| docker pull --quiet "${PROXY_IMAGE}" | ||
| docker image inspect "${PROXY_IMAGE}" --format '{{index .RepoDigests 0}} {{.Created}}' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor The digest printed here comes from the first pull only. Every later Source: code-review · claude-opus-5-5 Generated by Claude Code |
||
|
|
||
| - run: | | ||
| mise run postgres:up --extra-args "--detach --wait" | ||
|
|
||
| - name: Run integration tests against the published image | ||
| env: | ||
| RUST_BACKTRACE: "1" | ||
| run: | | ||
| mise run --output prefix test:integration | ||
|
|
||
| - name: Show proxy logs on failure | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. major A failed smoke test alerts nobody. The image is already published by then, and the only signal is a red job in the release run. Copying Sources: code-review, mattpocock-skills:code-review · claude-opus-5-5 Generated by Claude Code |
||
| if: failure() | ||
| run: | | ||
| docker logs --timestamps proxy 2>&1 || true | ||
| docker logs --timestamps proxy-tls 2>&1 || true | ||
|
|
||
| # The image is already published, so say so. Not the shared send-slack-notification | ||
| # action: it only fires on main, and a release run's ref is the tag. | ||
| - name: Notify Slack on failure | ||
| if: failure() && github.event_name == 'release' | ||
| uses: slackapi/slack-github-action@v1 | ||
| with: | ||
| payload: | | ||
| { | ||
| "text": ":alert::alert::alert:\n\nSmoke test failed for the published image `${{ env.PROXY_IMAGE }}`.\n\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>", | ||
| "channel": "#engineering" | ||
| } | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATION_WEBHOOK_URL }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,11 +71,17 @@ set -e | |
| {% set target = target_arch ~ "-unknown-linux-gnu" %} | ||
| {% set docker_platform = "linux/" ~ arch() | replace(from="x64", to="amd64") %} | ||
|
|
||
| # build a binary | ||
| mise run build:binary --target {{target}} | ||
|
|
||
| # build a new container | ||
| mise run build:docker --platform {{docker_platform}} | ||
| if [ -n "${PROXY_IMAGE:-}" ]; then | ||
| # Test a published image instead of building from source. | ||
| # tests/docker-compose.yml never pulls, so tag the image as the one it runs. | ||
| # Pull only when missing: test:integration calls proxy:up many times. | ||
| echo "Using published image: ${PROXY_IMAGE}" | ||
| docker image inspect "${PROXY_IMAGE}" >/dev/null 2>&1 || docker pull --quiet "${PROXY_IMAGE}" | ||
| docker tag "${PROXY_IMAGE}" cipherstash/proxy:latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor This leaves the published image tagged as the local Sources: code-review, mattpocock-skills:code-review · claude-opus-5-5 Generated by Claude Code |
||
| else | ||
| mise run build:binary --target {{target}} | ||
| mise run build:docker --platform {{docker_platform}} | ||
| fi | ||
|
|
||
| # Make the default invocation with `mise run proxy:up` work. | ||
| # The default mise environment configuration works for Proxy running as a process, connecting via a port forward. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor This workflow sets no
permissions:, so the job runs a pulled image and the test code with the default-scopeGITHUB_TOKEN, whichactions/checkoutkeeps in.git/config. The job only needspermissions: contents: read, and a called workflow may narrow the token.Source: company-skills:rust-security · claude-opus-5-5
Generated by Claude Code