@@ -17,24 +17,27 @@ jobs:
1717 name :
1818 - stable
1919 - beta
20- # The build matrix doesn't support the `env` variable in expressions
21- # see: jobs.nightly
22- # - nightly
20+ - nightly
2321 - Windows
22+ - macOS
2423 - native-tls
2524 - no default features
2625 - no cache
2726 - no gateway
28- - unstable Discord API features
27+ - chrono
2928 - zlib compression
3029 - zstd compression
3130 - zlib and zstd compression
3231
3332 include :
3433 - name : beta
3534 toolchain : beta
35+ - name : nightly
36+ toolchain : nightly
3637 - name : Windows
3738 os : windows-latest
39+ - name : macOS
40+ os : macos-latest
3841 - name : native-tls
3942 features : default_native_tls
4043 - name : no default features
4548 features : model rustls_backend
4649 - name : chrono
4750 features : chrono
48- - name : unstable API + typesize
49- features : default unstable typesize
50- dont-test : true
51- - name : builder without model
52- features : builder
53- dont-test : true
54- - name : unstable Discord API (no default features)
55- features : unstable
56- dont-test : true
5751 - name : zlib compression
5852 features : default transport_compression_zlib
5953 - name : zstd compression
@@ -68,60 +62,46 @@ jobs:
6862 - name : Install toolchain
6963 uses : dtolnay/rust-toolchain@master
7064 with :
71- toolchain : ${{ matrix.toolchain || 'stable' }}
65+ toolchain : ${{
66+ (matrix.toolchain == 'nightly' && env.rust_nightly)
67+ || matrix.toolchain
68+ || 'stable'
69+ }}
7270
7371 - name : Add problem matchers
74- shell : bash
7572 run : echo "::add-matcher::.github/matchers/rust.json"
7673
7774 - name : Cache
7875 uses : Swatinem/rust-cache@v2
7976
80- - name : Build all features
81- if : matrix.features == ''
82- run : cargo build --features full
83-
84- - name : Test all features
85- if : matrix.features == ''
86- run : cargo test --features full
77+ - name : Run tests
78+ run : cargo test --no-default-features --features "${{ matrix.features || 'full' }}"
8779
88- - name : Build some features
89- if : matrix.features
90- run : cargo build --no-default-features --features "${{ matrix.features }}"
91-
92- - name : Test some features
93- if : ${{ !matrix.dont-test && matrix.features }}
94- run : cargo test --no-default-features --features "${{ matrix.features }}"
95-
96- nightly :
97- name : Test (nightly)
80+ check :
81+ name : Check
9882 runs-on : ubuntu-latest
9983
100- steps :
101- - name : Checkout sources
102- uses : actions/checkout@v4
103-
104- - name : Install toolchain (${{ env.rust_nightly }})
105- uses : dtolnay/rust-toolchain@master
106- with :
107- toolchain : ${{ env.rust_nightly }}
108-
109- - name : Add problem matchers
110- shell : bash
111- run : echo "::add-matcher::.github/matchers/rust.json"
112-
113- - name : Cache
114- uses : Swatinem/rust-cache@v2
115-
116- - name : Build all features
117- run : cargo build --features full
118-
119- - name : Test all features
120- run : cargo test --features full
84+ strategy :
85+ fail-fast : false
86+ matrix :
87+ name :
88+ - builder without model
89+ - unstable + typesize
90+ - unstable (no default features)
91+ - temp cache
92+ - temp cache + typesize
12193
122- macOS :
123- name : Test (macOS)
124- runs-on : macos-latest
94+ include :
95+ - name : builder without model
96+ features : builder
97+ - name : unstable + typesize
98+ features : default unstable typesize
99+ - name : unstable (no default features)
100+ features : unstable
101+ - name : temp cache
102+ features : default temp_cache
103+ - name : temp cache + typesize
104+ features : default temp_cache typesize
125105
126106 steps :
127107 - name : Checkout sources
@@ -131,24 +111,20 @@ jobs:
131111 uses : dtolnay/rust-toolchain@stable
132112
133113 - name : Add problem matchers
134- shell : bash
135114 run : echo "::add-matcher::.github/matchers/rust.json"
136115
137116 - name : Cache
138117 uses : Swatinem/rust-cache@v2
139118
140- - name : Build
141- run : cargo build
142-
143- - name : Test
144- run : cargo test
119+ - name : Run checks
120+ run : cargo check --no-default-features --features "${{ matrix.features || 'full' }}"
145121
146122 MSRV :
147123 runs-on : ubuntu-latest
148124
149125 # We only run this job on the current branch as keeping MSRV the same is not important on next.
150126 if : (github.event_name == 'push' && github.ref_name == 'current') ||
151- (github.event_name == 'pull_request' && github.base_ref == 'current')
127+ (github.event_name == 'pull_request' && github.base_ref == 'current')
152128
153129 steps :
154130 - name : Checkout sources
@@ -165,7 +141,7 @@ jobs:
165141 - name : Cache
166142 uses : Swatinem/rust-cache@v2
167143
168- - name : Check
144+ - name : Run checks
169145 run : cargo check --features full
170146
171147 min_versions :
@@ -200,10 +176,8 @@ jobs:
200176 - name : Checkout sources
201177 uses : actions/checkout@v4
202178
203- - name : Install toolchain (${{ env.rust_nightly }})
204- uses : dtolnay/rust-toolchain@master
205- with :
206- toolchain : ${{ env.rust_nightly }}
179+ - name : Install toolchain
180+ uses : dtolnay/rust-toolchain@stable
207181
208182 - name : Add problem matchers
209183 run : echo "::add-matcher::.github/matchers/rust.json"
@@ -214,8 +188,6 @@ jobs:
214188 - name : Build docs
215189 run : |
216190 cargo doc --no-deps --features full,unstable
217- env :
218- RUSTDOCFLAGS : -D rustdoc::broken_intra_doc_links
219191
220192 examples :
221193 name : Examples
@@ -266,3 +238,5 @@ jobs:
266238 run : cargo check -p e15_webhook
267239 - name : ' Check example 16'
268240 run : cargo check -p e16_interactions_endpoint
241+ - name : ' Check testing example'
242+ run : cargo check -p testing
0 commit comments