Nightly Tasks #166
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 Tasks | |
| on: | |
| schedule: | |
| - cron: '0 7 * * *' # Nightly (ish) Pacific | |
| workflow_dispatch: | |
| env: | |
| RISC0_BUILD_LOCKED: 1 | |
| RISC0_RUST_TOOLCHAIN_VERSION: 1.88.0 | |
| RISC0_CPP_TOOLCHAIN_VERSION: 2024.01.05 | |
| jobs: | |
| crates_validate: | |
| runs-on: [self-hosted, cluster, Linux, X64, cpu] | |
| env: | |
| RUST_BACKTRACE: full | |
| RUST_LOG: info | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/rustup | |
| - run: cargo install --force --path risc0/cargo-risczero --locked | |
| - run: cargo run --bin rzup -- --verbose install rust $RISC0_RUST_TOOLCHAIN_VERSION | |
| - run: cargo run --bin rzup -- --verbose install cpp $RISC0_CPP_TOOLCHAIN_VERSION | |
| - run: cargo build --release | |
| working-directory: tools/crates-validator/ | |
| - name: Create working directory | |
| run: mkdir -p ${{ runner.temp }}/crate-validation/ | |
| - name: Validate profiles | |
| run: | | |
| target/release/main \ | |
| -p ${{ github.workspace }} \ | |
| -P profiles/profiles-1000.yaml \ | |
| -o ${{ runner.temp }}/crate-validation/profile-results.json &> ${{ runner.temp }}/crate-validation/crate-results.log | |
| shell: bash | |
| working-directory: tools/crates-validator/ | |
| - run: tail -n 1 ${{ runner.temp }}/crate-validation/crate-results.log | |
| if: always() | |
| - name: Upload artifact results | |
| uses: actions/upload-artifact@v4 | |
| if: always() # upload all artifacts even on failures | |
| with: | |
| name: crates-test-results | |
| path: ${{ runner.temp }}/crate-validation/ | |
| retention-days: 2 | |
| - name: Clone ghpages repo | |
| run: git clone "https://x-access-token:${{ secrets.BENCHMARK_TOKEN }}@github.com/risc0/ghpages.git" ${{ runner.temp }}/benchmarks/ | |
| - name: Export environment variable | |
| run: | | |
| echo "TEMP_DIR=${{ runner.temp }}" >> $GITHUB_ENV | |
| echo "GITHUB_SHA=${{ github.sha }}" >> $GITHUB_ENV | |
| - name: Commit results to risc0/ghpages | |
| env: | |
| GITHUB_SHA: ${{ github.sha }} | |
| run: bash ./parse_profile_compilation_results.sh | |
| working-directory: ./.github/scripts | |
| alert_devops_if_failed: | |
| runs-on: ubuntu-latest | |
| if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }} | |
| needs: [crates_validate] | |
| steps: | |
| - name: DevOps Alert | |
| env: | |
| NEEDS: ${{ toJSON(needs) }} | |
| run: | | |
| curl -X POST -H 'Content-type: application/json' --data '{"text":"Nightly Tasks Job Failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' ${{ secrets.DEVOPS_ALERT_WEBHOOK_URL }} |