11on :
22 push :
33 branches :
4- - main
4+ - main
55 pull_request :
66
77name : CI
@@ -12,20 +12,20 @@ jobs:
1212 name : Rustfmt
1313 runs-on : ubuntu-22.04
1414 steps :
15- - uses : actions/checkout@v4
16- - name : Cache cargo
17- uses : Swatinem/rust-cache@v1
18- - uses : IronCoreLabs/rust-toolchain@v1
19- with :
20- toolchain : nightly
21- components : rustfmt
22- - uses : actions-rs/cargo@v1
23- with :
24- command : fmt
25- args : --all -- --check
26- - name : Cancel workflow
27- if : failure()
28- uses : andymckay/cancel-action@0.2
15+ - uses : actions/checkout@v4
16+ - name : Cache cargo
17+ uses : Swatinem/rust-cache@v1
18+ - uses : IronCoreLabs/rust-toolchain@v1
19+ with :
20+ toolchain : nightly
21+ components : rustfmt
22+ - uses : actions-rs/cargo@v1
23+ with :
24+ command : fmt
25+ args : --all -- --check
26+ - name : Cancel workflow
27+ if : failure()
28+ uses : andymckay/cancel-action@0.2
2929
3030 # Build on all the architectures we intend to support, including cross compiled ones.
3131 build :
@@ -34,34 +34,34 @@ jobs:
3434 strategy :
3535 matrix :
3636 include :
37- - os : ubuntu-22.04
38- target : aarch64-linux-android # Android x64
39- - os : ubuntu-22.04
40- target : x86_64-unknown-linux-musl # Alpine Linux x86_64
41- - os : ubuntu-22.04
42- target : wasm32-unknown-unknown
43- features : --features wasm --no-default-features
44- - os : macos-13
45- target : aarch64-apple-ios
46- - os : macos-13
47- target : x86_64-apple-darwin # 64-bit OSX
48- - os : macos-14
49- target : aarch64-apple-darwin # 64-bit M1 OSX
50- - os : windows-2019
51- target : x86_64-pc-windows-msvc
37+ - os : ubuntu-22.04
38+ target : aarch64-linux-android # Android x64
39+ - os : ubuntu-22.04
40+ target : x86_64-unknown-linux-musl # Alpine Linux x86_64
41+ - os : ubuntu-22.04
42+ target : wasm32-unknown-unknown
43+ features : --features wasm --no-default-features
44+ - os : macos-13
45+ target : aarch64-apple-ios
46+ - os : macos-13
47+ target : x86_64-apple-darwin # 64-bit OSX
48+ - os : macos-14
49+ target : aarch64-apple-darwin # 64-bit M1 OSX
50+ - os : windows-2019
51+ target : x86_64-pc-windows-msvc
5252 steps :
53- - uses : actions/checkout@v4
54- - name : Cache cargo
55- uses : Swatinem/rust-cache@v1
56- - uses : IronCoreLabs/rust-toolchain@v1
57- with :
58- toolchain : stable
59- target : ${{ matrix.target }}
60- - uses : actions-rs/cargo@v1
61- with :
62- use-cross : true
63- command : build
64- args : --release --target=${{ matrix.target }} ${{ matrix.features }}
53+ - uses : actions/checkout@v4
54+ - name : Cache cargo
55+ uses : Swatinem/rust-cache@v1
56+ - uses : IronCoreLabs/rust-toolchain@v1
57+ with :
58+ toolchain : stable
59+ target : ${{ matrix.target }}
60+ - uses : actions-rs/cargo@v1
61+ with :
62+ use-cross : true
63+ command : build
64+ args : --release --target=${{ matrix.target }} ${{ matrix.features }}
6565
6666 # Run the tests on only one architecture, against various Rust versions.
6767 test :
@@ -70,20 +70,20 @@ jobs:
7070 strategy :
7171 matrix :
7272 rust :
73- - stable
74- - beta
75- - 1.70 .0 # MSRV
73+ - stable
74+ - beta
75+ - 1.74 .0 # MSRV
7676 fail-fast : false
7777 steps :
78- - uses : actions/checkout@v4
79- - name : Cache cargo
80- uses : Swatinem/rust-cache@v1
81- - uses : IronCoreLabs/rust-toolchain@v1
82- with :
83- toolchain : ${{ matrix.rust }}
84- - uses : actions-rs/cargo@v1
85- with :
86- command : test
78+ - uses : actions/checkout@v4
79+ - name : Cache cargo
80+ uses : Swatinem/rust-cache@v1
81+ - uses : IronCoreLabs/rust-toolchain@v1
82+ with :
83+ toolchain : ${{ matrix.rust }}
84+ - uses : actions-rs/cargo@v1
85+ with :
86+ command : test
8787
8888 # Benchmark current and base revisions, if this is a PR.
8989 bench :
@@ -93,80 +93,80 @@ jobs:
9393 strategy :
9494 matrix :
9595 include :
96- - name : current
97- ref : ${{ github.ref }}
98- - name : base
99- ref : ${{ github.base_ref }}
96+ - name : current
97+ ref : ${{ github.ref }}
98+ - name : base
99+ ref : ${{ github.base_ref }}
100100 steps :
101- - uses : actions/checkout@v4
102- with :
103- ref : ${{ matrix.ref }}
104- - name : Cache cargo
105- uses : Swatinem/rust-cache@v1
106- - uses : IronCoreLabs/rust-toolchain@v1
107- with :
108- toolchain : stable
109- - uses : actions-rs/cargo@v1
110- with :
111- command : install
112- args : critcmp
113- - uses : actions-rs/cargo@v1
114- with :
115- command : bench
116- args : -- --save-baseline ${{ matrix.name }}
117- - run : critcmp --export ${{ matrix.name }} > results.json
118- - name : Store benchmark results
119- uses : actions/upload-artifact@v4
120- with :
121- name : bench-${{ matrix.name }}
122- path : results.json
101+ - uses : actions/checkout@v4
102+ with :
103+ ref : ${{ matrix.ref }}
104+ - name : Cache cargo
105+ uses : Swatinem/rust-cache@v1
106+ - uses : IronCoreLabs/rust-toolchain@v1
107+ with :
108+ toolchain : stable
109+ - uses : actions-rs/cargo@v1
110+ with :
111+ command : install
112+ args : critcmp
113+ - uses : actions-rs/cargo@v1
114+ with :
115+ command : bench
116+ args : -- --save-baseline ${{ matrix.name }}
117+ - run : critcmp --export ${{ matrix.name }} > results.json
118+ - name : Store benchmark results
119+ uses : actions/upload-artifact@v4
120+ with :
121+ name : bench-${{ matrix.name }}
122+ path : results.json
123123
124124 # Add a comment to the PR with benchmark results. Only if everything else passed, and this is a PR.
125125 bench_results :
126126 needs :
127- - bench
127+ - bench
128128 name : Upload benchmark results
129129 runs-on : ubuntu-22.04
130130 steps :
131- - uses : actions/checkout@v4
132- - name : Cache cargo
133- uses : Swatinem/rust-cache@v1
134- - name : Retrieve benchmark results
135- uses : actions/download-artifact@v4
136- with :
137- name : bench-current
138- - name : Delete artifact
139- uses : geekyeggo/delete-artifact@v1
140- with :
141- name : bench-current
142- failOnError : false
143- - name : Retrieve benchmark results
144- uses : actions/download-artifact@v4
145- with :
146- name : bench-base
147- - name : Delete artifact
148- uses : geekyeggo/delete-artifact@v1
149- with :
150- name : bench-base
151- failOnError : false
152- - uses : IronCoreLabs/rust-toolchain@v1
153- with :
154- toolchain : stable
155- - uses : actions-rs/cargo@v1
156- with :
157- command : install
158- args : critcmp
159- - name : Compare benchmarks
160- run : |
161- if ! critcmp bench-base/results.json bench-current/results.json -t 10 ; then
162- echo "# Benchmark blew big budget! Bad!" > comment.md
163- fi
164- echo "Benchmark results comparing with base:" >> comment.md
165- echo '```' >> comment.md
166- critcmp bench-base/results.json bench-current/results.json -t 2 >> comment.md || true
167- echo '```' >> comment.md
168- cat comment.md
169- mv comment.md .github/workflows/comment.md
131+ - uses : actions/checkout@v4
132+ - name : Cache cargo
133+ uses : Swatinem/rust-cache@v1
134+ - name : Retrieve benchmark results
135+ uses : actions/download-artifact@v4
136+ with :
137+ name : bench-current
138+ - name : Delete artifact
139+ uses : geekyeggo/delete-artifact@v1
140+ with :
141+ name : bench-current
142+ failOnError : false
143+ - name : Retrieve benchmark results
144+ uses : actions/download-artifact@v4
145+ with :
146+ name : bench-base
147+ - name : Delete artifact
148+ uses : geekyeggo/delete-artifact@v1
149+ with :
150+ name : bench-base
151+ failOnError : false
152+ - uses : IronCoreLabs/rust-toolchain@v1
153+ with :
154+ toolchain : stable
155+ - uses : actions-rs/cargo@v1
156+ with :
157+ command : install
158+ args : critcmp
159+ - name : Compare benchmarks
160+ run : |
161+ if ! critcmp bench-base/results.json bench-current/results.json -t 10 ; then
162+ echo "# Benchmark blew big budget! Bad!" > comment.md
163+ fi
164+ echo "Benchmark results comparing with base:" >> comment.md
165+ echo '```' >> comment.md
166+ critcmp bench-base/results.json bench-current/results.json -t 2 >> comment.md || true
167+ echo '```' >> comment.md
168+ cat comment.md
169+ mv comment.md .github/workflows/comment.md
170170 # This will post a comment to the PR with benchmark results, but it's disabled because it's annoying.
171171 # - uses: harupy/comment-on-pr@c0522c4
172172 # env:
0 commit comments