Test: v0.30.0 #658
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| run-name: | | |
| ${{ (github.event_name == 'pull_request' && format('Test (PR #{0}): {1}', github.event.number, github.event.pull_request.title)) | |
| || format('Test: {0}', github.event.head_commit.message) }} | |
| on: | |
| # Event: A maintainer has pushed commits or merged a PR to main or the | |
| # eql_v3 staging branch. | |
| push: | |
| # Limiting push events to these branches prevents duplicate runs of this | |
| # workflow when maintainers push to internal PRs. | |
| branches: | |
| - main | |
| - eql_v3 | |
| # Event: A contributor has created or updated a PR. | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| branches: | |
| - main | |
| - eql_v3 | |
| # Event: manual invocation of the workflow | |
| workflow_dispatch: | |
| jobs: | |
| pr: | |
| name: Pull Request Details | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| if: ${{ github.event_name == 'pull_request' }} | |
| outputs: | |
| branch: ${{ steps.pr-ref.outputs.branch || github.event.repository.default_branch }} | |
| steps: | |
| - name: PR Branch | |
| id: pr-ref | |
| shell: bash | |
| run: echo "branch=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')" | tee -a "$GITHUB_OUTPUT" | |
| env: | |
| REPO: ${{ github.repository }} | |
| PR_NO: ${{ github.event.number }} | |
| GH_TOKEN: ${{ github.token }} | |
| # Labeling a PR with a `ci:full-matrix` label does a full matrix build on | |
| # every run of this workflow for that PR, in addition to the other tests. | |
| full-matrix: | |
| name: Build | |
| if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:full-matrix') }} | |
| needs: [pr] | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| ref: ${{ needs.pr.outputs.branch }} | |
| update-version: true | |
| github-release: false | |
| tests: | |
| name: Tests | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| env: | |
| CS_WORKSPACE_CRN: ${{ secrets.CS_WORKSPACE_CRN }} | |
| CS_CLIENT_ACCESS_KEY: ${{ secrets.CS_CLIENT_ACCESS_KEY }} | |
| CS_CLIENT_ID: ${{ secrets.CS_CLIENT_ID }} | |
| CS_CLIENT_KEY: ${{ secrets.CS_CLIENT_KEY }} | |
| CS_ZEROKMS_HOST: https://ap-southeast-2.aws.zerokms.cipherstashmanaged.net | |
| CS_CTS_HOST: https://ap-southeast-2.aws.cts.cipherstashmanaged.net | |
| PGPORT: 5432 | |
| PGDATABASE: cipherstash | |
| PGUSER: cipherstash | |
| PGPASSWORD: password | |
| PGHOST: localhost | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Setup Neon Environment | |
| id: neon | |
| uses: ./.github/actions/setup | |
| with: | |
| platform: linux-x64-gnu | |
| - name: Build | |
| shell: bash | |
| run: npm run debug | |
| - name: Add wasm32 target | |
| shell: bash | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Cargo check (wasm32) | |
| shell: bash | |
| run: cargo check --target wasm32-unknown-unknown -p protect-ffi | |
| # The `mise run test:integration:all` step below builds wasm artifacts | |
| # because `tests/wasm-round-trip.test.ts` loads | |
| # `dist/wasm/protect_ffi_inline.js` at module-graph time. Pinned to | |
| # the same version used by the build workflow. | |
| - name: Install wasm-pack | |
| uses: baptiste0928/cargo-install@c7dafcfd8a0035d58dfc65d0fbaf71a9ac347715 # v2 | |
| with: | |
| crate: wasm-pack | |
| version: '0.13.1' | |
| - name: Rust Lint | |
| run: mise lint:rust | |
| - name: Test (typecheck, lint, & Rust) | |
| shell: bash | |
| run: npm test | |
| - name: Integration test setup | |
| run: mise setup | |
| - name: Test (integration) | |
| run: mise run test:integration:all |