nightly-macos-test #385
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: "nightly-macos-test" | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Run at midnight UTC every day | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| common-tests: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run Common Tests | |
| uses: ./.github/actions/test-blueprint | |
| with: | |
| os: macos-latest | |
| test-target: common-tests | |
| test-name: macos-common-tests | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| gc-tests: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run GC Tests | |
| uses: ./.github/actions/test-blueprint | |
| with: | |
| os: macos-latest | |
| test-target: gc-tests | |
| test-name: macos-gc-tests | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| systems-go-tests: | |
| strategy: | |
| matrix: | |
| build_type: [release, debug] | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run Tests | |
| uses: ./.github/actions/test-blueprint | |
| with: | |
| os: macos-latest | |
| test-target: ${{ matrix.build_type }}-systems-go | |
| test-name: macos-${{ matrix.build_type }}-tests | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| motoko-core-tests: | |
| needs: systems-go-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get `motoko` Repo | |
| uses: actions/checkout@v6 | |
| - name: Populate `moc` | |
| uses: ./.github/actions/test-blueprint | |
| with: | |
| os: ubuntu-latest | |
| test-target: moc | |
| test-name: fetch-moc | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Build `moc` | |
| run: | | |
| nix build .#moc --print-out-paths | |
| - name: Save the `test-blueprint` action | |
| # This is needed by the "Post Populate `moc`" step (cleanup) | |
| # but since the checkout of `motoko-core` destroys the `pwd` contents | |
| # we have to keep it elsewhere and restore later. | |
| run: cp -r ./.github/actions/test-blueprint .. | |
| - name: Get `motoko-core` Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: dfinity/motoko-core | |
| fetch-depth: "0" | |
| - name: Restore the `test-blueprint` action | |
| run: mv ../test-blueprint ./.github/actions | |
| - name: Set up `mops` | |
| uses: dfinity/motoko-core/.github/actions/setup@main | |
| - name: Set up `mops` cache | |
| run: | | |
| npx ic-mops --version | |
| npx ${DFX_MOC_PATH} --version | |
| - name: Fixup `mops` cache | |
| run: | | |
| ln -sf /nix/store/*-moc/bin/moc $(cat .mops/moc-*) | |
| npx ${DFX_MOC_PATH} --version | |
| - name: Run `motoko-core` Tests | |
| run: npm test | |
| create-issue: | |
| needs: [common-tests, gc-tests, systems-go-tests, motoko-core-tests] | |
| if: ${{ always() && contains(needs.*.result, 'failure') && github.ref == 'refs/heads/master' }} | |
| runs-on: ubuntu-latest # No need to run on macOS, the ubuntu runner should be cheaper to run. | |
| steps: | |
| - name: Create Issue | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const date = new Date().toISOString().split('T')[0]; | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: `Nightly macOS Test Failure (${date})`, | |
| body: `Nightly tests for macOS failed. Please investigate.\n\nWorkflow run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, | |
| labels: ['macos-failure', 'bug'] | |
| }); |