Skip to content

Commit 54b5957

Browse files
author
Sven
committed
ci: fix wrong toolchain usage
Since the Rust version has been pinned down the CI workflow breaks due to cargo picking up the file and using 1.34.2 for all matrix configurations. The solution is to use the @action-rs/toolchain actions to force a specific toolchain for the CI job.
1 parent 92b11d6 commit 54b5957

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

.github/workflows/rust.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,38 @@ name: Rust CI
22

33
on:
44
push:
5-
branches: [ master, github-actions ]
5+
branches: [master, github-actions]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
1312

1413
strategy:
1514
matrix:
1615
rust: ["1.34.2", stable, beta, nightly]
1716
features: ["", "rayon"]
1817
command: [test, benchmark]
18+
1919
steps:
20-
- uses: actions/checkout@v2
21-
- run: rustup default ${{ matrix.rust }}
22-
- name: build
23-
run: >
24-
cargo build --verbose --no-default-features --features "$FEATURES"
25-
- name: test
26-
run: >
27-
cargo test --tests --benches --no-default-features --features "$FEATURES"
28-
if: ${{ matrix.command == 'test' && matrix.rust != '1.34.2' }}
29-
env:
30-
FEATURES: ${{ matrix.features }}
31-
- name: benchmark
32-
run: cargo bench --bench decoding_benchmark --no-default-features --features "$FEATURES" -- --warm-up-time 1 --measurement-time 1 --sample-size 25
33-
if: ${{ matrix.command == 'benchmark' && matrix.rust != '1.34.2' }}
34-
env:
35-
FEATURES: ${{ matrix.features }}
20+
- name: Installing Rust toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
override: true
24+
toolchain: ${{ matrix.rust }}
25+
- uses: actions/checkout@v2
26+
- name: build
27+
run: >
28+
cargo build --verbose --no-default-features --features "$FEATURES"
29+
- name: test
30+
run: >
31+
cargo test --tests --benches --no-default-features --features "$FEATURES"
32+
if: ${{ matrix.command == 'test' && matrix.rust != '1.34.2' }}
33+
env:
34+
FEATURES: ${{ matrix.features }}
35+
- name: benchmark
36+
run: cargo bench --bench decoding_benchmark --no-default-features --features "$FEATURES" -- --warm-up-time 1 --measurement-time 1 --sample-size 25
37+
if: ${{ matrix.command == 'benchmark' && matrix.rust != '1.34.2' }}
38+
env:
39+
FEATURES: ${{ matrix.features }}

0 commit comments

Comments
 (0)