-
Notifications
You must be signed in to change notification settings - Fork 200
130 lines (111 loc) · 4.1 KB
/
test-rust-workspace-msrv.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Test (MSRV check)
# TL;DR https://github.com/noir-lang/noir/issues/4384
#
# This workflow acts to ensure that we can publish to crates.io, we need this extra check as libraries don't respect the Cargo.lock file committed in this repository.
# We must then always be able to build the workspace using the latest versions of all of our dependencies, so we explicitly update them and build in this workflow.
on:
schedule:
# Run a nightly check at 2 AM UTC
- cron: "0 2 * * *"
push:
branches:
- master
# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-test-artifacts:
name: Build test artifacts
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu
# We force the ACVM crate and all of its dependencies to update their dependencies
# This ensures that we'll be able to build the crates when they're being published.
- name: Update Cargo.lock
run: |
cargo update --package acvm --aggressive
cargo update --package bn254_blackbox_solver --aggressive
- uses: Swatinem/rust-cache@v2
with:
key: x86_64-unknown-linux-gnu-msrv-check
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: nextest@0.9.67
- name: Build and archive tests
run: cargo nextest archive --workspace --release --archive-file nextest-archive.tar.zst
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst
run-tests:
name: "Run tests (partition ${{matrix.partition}})"
runs-on: ubuntu-latest
needs: [build-test-artifacts]
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: nextest@0.9.67
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
- name: Run tests
run: |
cargo nextest run --archive-file nextest-archive.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: ubuntu-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, '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/ACVM_NOT_PUBLISHABLE.md