Test (ARM64) #228
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 (ARM64) | |
| # This workflow runs the project Rust tests on a daily basis on ARM64. | |
| # The main intention of doing this is making sure that build artifacts end up exactly | |
| # the same as in X86, but this workflow runs all tests to also make sure everything | |
| # works the same way on ARM64. Because of this, most of the code here is similar | |
| # to that in test-rust-workspace.yml | |
| on: | |
| schedule: | |
| # Run a check at 9 AM UTC | |
| - cron: "0 9 * * *" | |
| jobs: | |
| build-test-artifacts: | |
| name: Build test artifacts | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup toolchain | |
| uses: dtolnay/[email protected] | |
| with: | |
| targets: aarch64-apple-darwin | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: aarch64-apple-darwin | |
| cache-on-failure: true | |
| save-if: ${{ github.event_name != 'merge_group' }} | |
| - name: Install nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: [email protected] | |
| - name: Build and archive tests | |
| run: cargo nextest archive --workspace --features noirc_frontend/nextest --archive-file nextest-archive-arm64.tar.zst | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload archive to workflow | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nextest-archive-arm64 | |
| path: nextest-archive-arm64.tar.zst | |
| run-tests: | |
| name: "Run tests (partition ${{matrix.partition}})" | |
| runs-on: macos-latest | |
| needs: [build-test-artifacts] | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| partition: [1, 2, 3, 4] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup toolchain | |
| uses: dtolnay/[email protected] | |
| with: | |
| targets: aarch64-apple-darwin | |
| - name: Install nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: [email protected] | |
| - name: Download archive | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nextest-archive-arm64 | |
| - name: Run tests | |
| run: | | |
| RUST_MIN_STACK=8388608 \ | |
| cargo nextest run --archive-file nextest-archive-arm64.tar.zst \ | |
| --partition count:${{ matrix.partition }}/4 \ | |
| --no-fail-fast | |
| # This is a job which depends on all test jobs and reports the overall status. | |
| # This allows us to add/remove test jobs without having to update the required workflows. | |
| tests-end: | |
| name: Rust End | |
| runs-on: macos-latest | |
| # We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping. | |
| if: ${{ always() }} | |
| needs: | |
| - run-tests | |
| steps: | |
| - name: Report overall success | |
| run: | | |
| if [[ $FAIL == true ]]; then | |
| exit 1 | |
| else | |
| exit 0 | |
| fi | |
| env: | |
| # We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole. | |
| FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} | |
| - name: Checkout | |
| if: ${{ failure() }} | |
| uses: actions/checkout@v4 | |
| # Raise an issue if the tests failed | |
| - name: Alert on failed publish | |
| uses: JasonEtco/create-an-issue@v2 | |
| if: ${{ failure() }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| WORKFLOW_NAME: ${{ github.workflow }} | |
| WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| with: | |
| update_existing: true | |
| filename: .github/TESTS_ARE_FAILING_ON_ARM64.md |