chore: Strip local features #2773
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: check-test | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - latest | |
| pull_request: | |
| # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -xe {0} | |
| jobs: | |
| ci-test: | |
| name: ci-test ${{ matrix.name }} | |
| runs-on: ubuntu-24.04 | |
| env: | |
| # kache 0.12 can report build-script hits without restoring Cargo's expected executable. | |
| KACHE_CACHE_EXECUTABLES: "0" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: test.sh | |
| report: junit-default.xml | |
| features: "" | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c | |
| with: | |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Start postgres | |
| run: docker run -d -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:18 | |
| - name: Populate the nix store | |
| run: nix develop --command echo | |
| # Test WASMs are content-hashed by filename and don't change often, so they share one global cache. | |
| - id: wasm-cache | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| target/wasm-cache | |
| test-codegen-cache | |
| key: wasm-cache-${{ matrix.report }}-${{ runner.os }}-${{ github.run_id }} | |
| restore-keys: | | |
| wasm-cache-${{ matrix.report }}-${{ runner.os }}- | |
| - uses: kunobi-ninja/kache-action@a257c055543c2840700a9bbca8f9c3094a421b1b # main, post-v1: adds pr-comment input | |
| with: | |
| pr-comment: false | |
| - name: Build tests | |
| id: build-tests | |
| run: nix develop --command cargo nextest run --workspace --no-run | |
| - name: Populate codegen cache | |
| run: nix develop --command scripts/test-phase1.sh | |
| env: | |
| ADDITIONAL_FEATURES: ${{ matrix.features }} | |
| - name: Run tests | |
| run: nix develop --command scripts/test-phase2.sh | |
| env: | |
| CI: true | |
| TEST_POSTGRES_HOST: "localhost" | |
| TEST_POSTGRES_USER: "postgres" | |
| TEST_POSTGRES_PASSWORD: "postgres" | |
| TEST_POSTGRES_DATABASE_PREFIX: "obelisk_test" | |
| CARGO_INSTA_TEST: true # reject unreferenced snapshots | |
| ADDITIONAL_FEATURES: ${{ matrix.features }} | |
| # Reduce cache size — hashed WASMs are cached separately (target/wasm-cache/). | |
| - name: Clean build artifacts before caching | |
| if: always() | |
| run: | | |
| rm -rf target/debug/incremental target/release_testprograms target/release_wasm_runtime | |
| - name: Save wasm cache | |
| if: always() && steps.build-tests.outcome == 'success' | |
| uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| target/wasm-cache | |
| test-codegen-cache | |
| key: ${{ steps.wasm-cache.outputs.cache-primary-key }} | |
| # Report results | |
| - name: Rename test report | |
| if: always() | |
| run: mv target/nextest/ci-test/junit.xml target/nextest/ci-test/${{ matrix.report }} | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | |
| with: | |
| name: ${{ matrix.report }} | |
| path: target/nextest/ci-test/${{ matrix.report }} | |
| - name: Report results in GitHub UI | |
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 | |
| if: always() | |
| with: | |
| name: Rust tests | |
| path: target/nextest/ci-test/${{ matrix.report }} | |
| reporter: java-junit |