2929 CARGO_TERM_COLOR : always
3030 SCCACHE_GHA_ENABLED : " true"
3131 RUSTC_WRAPPER : " sccache"
32+ RUSTFLAGS : -D warnings
33+ RUSTDOCFLAGS : -D warnings
3234jobs :
3335 fmt :
3436 runs-on : ubuntu-24.04
35- name : stable / fmt
3637 steps :
3738 - uses : actions/checkout@v4
38- - name : Install stable
39- uses : dtolnay/rust-toolchain@stable
40- with :
41- components : rustfmt
39+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
4240 - name : Check formatting
4341 run : cargo fmt --check --all
4442 clippy :
4543 runs-on : ubuntu-24.04
46- name : ${{ matrix.toolchain }} / clippy
47- strategy :
48- fail-fast : false
49- matrix :
50- toolchain : [stable, beta]
5144 steps :
5245 - uses : actions/checkout@v4
5346 - name : Install system dependencies
5447 run : |
55- sudo apt update
56- sudo apt-get -y install libsqlite3-dev libssl-dev
57- - name : Install ${{ matrix.toolchain }}
58- uses : dtolnay/rust-toolchain@master
59- with :
60- toolchain : ${{ matrix.toolchain }}
61- components : clippy
62- - name : Install sccache-cache
63- uses : mozilla-actions/sccache-action@v0.0.9
48+ sudo apt-get update
49+ sudo apt-get -y install libsqlite3-dev
50+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
51+ - uses : mozilla-actions/sccache-action@v0.0.9
6452 - name : cargo clippy
65- run : cargo clippy --locked --all-targets --all-features --workspace -- -D warnings
53+ run : cargo clippy --locked --all-targets --all-features --workspace
6654 doc :
6755 runs-on : ubuntu-24.04
68- name : nightly / doc
69- env :
70- RUSTDOCFLAGS : -Dwarnings
7156 steps :
7257 - uses : actions/checkout@v4
7358 - name : Install system dependencies
7459 run : |
75- sudo apt update
76- sudo apt-get -y install libsqlite3-dev libssl-dev
77- - name : Install nightly
78- uses : dtolnay/rust-toolchain@nightly
79- - name : Install sccache-cache
80- uses : mozilla-actions/sccache-action@v0.0.9
60+ sudo apt-get update
61+ sudo apt-get -y install libsqlite3-dev
62+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
63+ with :
64+ toolchain : nightly
65+ - uses : mozilla-actions/sccache-action@v0.0.9
8166 - name : Install cargo-docs-rs
8267 uses : dtolnay/install@cargo-docs-rs
8368 - run : cargo docs-rs --locked
8469
85- hack :
70+ features :
8671 runs-on : ubuntu-24.04
87- name : ubuntu / stable / features
8872 steps :
8973 - uses : actions/checkout@v4
9074 - name : Install system dependencies
9175 run : |
92- sudo apt update
93- sudo apt-get -y install libsqlite3-dev libssl-dev
94- - name : Install stable
95- uses : dtolnay/rust-toolchain@stable
96- - name : Install sccache-cache
97- uses : mozilla-actions/sccache-action@v0.0.9
76+ sudo apt-get update
77+ sudo apt-get -y install libsqlite3-dev
78+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
79+ - uses : mozilla-actions/sccache-action@v0.0.9
9880 - name : cargo install cargo-hack
9981 uses : taiki-e/install-action@cargo-hack
10082 - name : cargo hack test
@@ -103,61 +85,53 @@ jobs:
10385 run : cargo hack --each-feature test --locked
10486 minimal-versions :
10587 runs-on : ubuntu-24.04
106- name : ubuntu / stable / minimal-versions
10788 steps :
10889 - uses : actions/checkout@v4
10990 - name : Install system dependencies
11091 run : |
111- sudo apt update
112- sudo apt-get -y install libsqlite3-dev libssl-dev
113- - name : Install stable
114- uses : dtolnay/rust-toolchain@stable
115- - name : Install nightly for -Zminimal-versions
116- uses : dtolnay/rust-toolchain@nightly
117- - name : Install cargo hack
118- uses : taiki-e/install-action@cargo-hack
119- - name : Install cargo minimal-versions
120- uses : taiki-e/install-action@cargo-minimal-versions
121- - name : Install sccache-cache
122- uses : mozilla-actions/sccache-action@v0.0.9
123- - name : rustup default stable
124- run : rustup default stable
92+ sudo apt-get update
93+ sudo apt-get -y install libsqlite3-dev
94+ - name : install rust stable
95+ uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
96+ - name : install rust nightly
97+ uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
98+ with :
99+ toolchain : nightly
100+ - uses : mozilla-actions/sccache-action@v0.0.9
101+ - uses : taiki-e/install-action@v2.49.43
102+ with :
103+ tool : cargo-hack,cargo-minimal-versions
104+ - run : rustup default stable
125105 - name : Check minimal versions
126106 run : cargo minimal-versions check --workspace --ignore-private --detach-path-deps=skip-exact --direct
127- env :
128- RUSTFLAGS : -D warnings
129107 msrv :
130108 runs-on : ubuntu-24.04
131109 strategy :
132110 matrix :
133111 msrv : [1.78]
134- name : ubuntu / ${{ matrix.msrv }}
112+ name : msrv / ${{ matrix.msrv }}
135113 steps :
136114 - uses : actions/checkout@v4
137115 - name : Install system dependencies
138116 run : |
139117 sudo apt update
140- sudo apt-get -y install libsqlite3-dev libssl-dev
141- - name : Install ${{ matrix.msrv }}
142- uses : dtolnay/rust-toolchain@master
118+ sudo apt-get -y install libsqlite3-dev
119+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
143120 with :
144121 toolchain : ${{ matrix.msrv }}
145- - name : Install sccache-cache
146- uses : mozilla-actions/sccache-action@v0.0.9
147- - name : Install cargo hack
148- uses : taiki-e/install-action@cargo-hack
122+ - uses : mozilla-actions/sccache-action@v0.0.9
123+ - uses : taiki-e/install-action@cargo-hack
149124 - name : cargo +${{ matrix.msrv }} check
150- run : cargo +${{ matrix.msrv }} hack --no-dev-deps check --all-features --exclude astarte-device-sdk-mock --exclude e2e-test
125+ run : cargo +${{ matrix.msrv }} hack --no-dev-deps check --all-features -p astarte-device-sdk
151126 # Run semver-check on release branch push or PR
152127 semver :
153128 if : startsWith(github.base_ref, 'release-') || startsWith(github.ref, 'release-')
154- name : stable / semver
155129 runs-on : ubuntu-24.04
156130 steps :
157131 - uses : actions/checkout@v4
158- - name : Install sccache-cache
159- uses : mozilla-actions/sccache-action@v0.0.9
160- - name : Check semver
132+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
133+ - uses : mozilla-actions/sccache-action@v0.0.9
134+ - name : Check library API semver breakages
161135 uses : obi1kenobi/cargo-semver-checks-action@v2
162136 with :
163137 release-type : patch
@@ -170,9 +144,7 @@ jobs:
170144 - name : Install system dependencies
171145 run : |
172146 sudo apt update
173- sudo apt-get -y install libsqlite3-dev libssl-dev
174- - name : Install sccache-cache
175- uses : mozilla-actions/sccache-action@v0.0.9
176- - name : Install stable
177- uses : dtolnay/rust-toolchain@stable
147+ sudo apt-get -y install libsqlite3-dev
148+ - uses : actions-rust-lang/setup-rust-toolchain@v1.11.0
149+ - uses : mozilla-actions/sccache-action@v0.0.9
178150 - run : ./scripts/check-for-publish.sh
0 commit comments