1
1
on :
2
2
push :
3
3
branches :
4
- - main
4
+ - main
5
5
pull_request :
6
6
7
7
name : CI
@@ -12,20 +12,20 @@ jobs:
12
12
name : Rustfmt
13
13
runs-on : ubuntu-22.04
14
14
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
-
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
+
29
29
30
30
# Build on all the architectures we intend to support, including cross compiled ones.
31
31
build :
@@ -34,34 +34,34 @@ jobs:
34
34
strategy :
35
35
matrix :
36
36
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
52
52
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 }}
65
65
66
66
# Run the tests on only one architecture, against various Rust versions.
67
67
test :
@@ -70,20 +70,20 @@ jobs:
70
70
strategy :
71
71
matrix :
72
72
rust :
73
- - stable
74
- - beta
75
- - 1.70 .0 # MSRV
73
+ - stable
74
+ - beta
75
+ - 1.74 .0 # MSRV
76
76
fail-fast : false
77
77
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
87
87
88
88
# Benchmark current and base revisions, if this is a PR.
89
89
bench :
@@ -93,80 +93,80 @@ jobs:
93
93
strategy :
94
94
matrix :
95
95
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 }}
100
100
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
123
123
124
124
# Add a comment to the PR with benchmark results. Only if everything else passed, and this is a PR.
125
125
bench_results :
126
126
needs :
127
- - bench
127
+ - bench
128
128
name : Upload benchmark results
129
129
runs-on : ubuntu-22.04
130
130
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
170
170
# This will post a comment to the PR with benchmark results, but it's disabled because it's annoying.
171
171
# - uses: harupy/comment-on-pr@c0522c4
172
172
# env:
0 commit comments