Skip to content

Commit bf19621

Browse files
committed
Update CI
1 parent 9b1d269 commit bf19621

File tree

12 files changed

+133
-132
lines changed

12 files changed

+133
-132
lines changed

.github/actions/setup-rust/action.yaml

-43
This file was deleted.

.github/workflows/ci.yml

+69-66
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,50 @@ on:
1010

1111
jobs:
1212
fmt:
13+
strategy:
14+
matrix:
15+
toolchain:
16+
- nightly
1317
runs-on: ubuntu-latest
1418
steps:
1519
- uses: actions/checkout@v4
16-
17-
- name: Setup Rust
18-
uses: ./.github/actions/setup-rust
20+
- uses: dtolnay/rust-toolchain@master
1921
with:
20-
key: fmt
21-
toolchain: nightly
22+
toolchain: ${{ matrix.toolchain }}
2223
components: rustfmt
23-
2424
- run: cargo fmt --all -- --check
2525

2626
clippy:
2727
strategy:
2828
matrix:
2929
toolchain:
30-
- stable
30+
- nightly
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/checkout@v4
34-
35-
- name: Setup Rust
36-
uses: ./.github/actions/setup-rust
34+
- uses: dtolnay/rust-toolchain@master
3735
with:
38-
key: clippy
3936
toolchain: ${{ matrix.toolchain }}
4037
components: clippy
41-
4238
- run: cargo clippy --workspace --all-targets -- -D warnings
4339

4440
check:
4541
strategy:
4642
matrix:
4743
toolchain:
48-
- stable
44+
- "1.81"
45+
package:
46+
- "zipsign"
47+
include:
48+
- toolchain: "1.73"
49+
package: zipsign-api
4950
runs-on: ubuntu-latest
5051
steps:
5152
- uses: actions/checkout@v4
52-
53-
- name: Setup Rust
54-
uses: ./.github/actions/setup-rust
53+
- uses: dtolnay/rust-toolchain@master
5554
with:
56-
key: check
5755
toolchain: ${{ matrix.toolchain }}
58-
59-
- run: cargo check --workspace --all-targets
56+
- run: cargo check --package ${{ matrix.package }} --all-targets
6057

6158
test:
6259
strategy:
@@ -66,20 +63,16 @@ jobs:
6663
os:
6764
- ubuntu-22.04
6865
- windows-2022
69-
- macos-12
66+
- macos-13
7067
versions:
7168
- ""
7269
- "-Zminimal-versions"
7370
runs-on: ${{ matrix.os }}
7471
steps:
7572
- uses: actions/checkout@v4
76-
77-
- name: Setup Rust
78-
uses: ./.github/actions/setup-rust
73+
- uses: dtolnay/rust-toolchain@master
7974
with:
80-
key: test${{ matrix.versions }}
8175
toolchain: ${{ matrix.toolchain }}
82-
components: clippy
8376

8477
- name: Update lockfile
8578
run: cargo generate-lockfile ${{ matrix.versions }}
@@ -89,55 +82,41 @@ jobs:
8982
- run: cargo test --workspace --all-targets
9083

9184
doc:
85+
strategy:
86+
matrix:
87+
toolchain:
88+
- nightly
9289
runs-on: ubuntu-latest
9390
steps:
9491
- uses: actions/checkout@v4
95-
96-
- name: Setup Rust
97-
uses: ./.github/actions/setup-rust
92+
- uses: dtolnay/rust-toolchain@master
9893
with:
99-
key: doc
100-
toolchain: nightly
101-
102-
- run: cargo +nightly doc --all-features --no-deps
94+
toolchain: ${{ matrix.toolchain }}
95+
- run: cargo doc --workspace --all-features --no-deps
10396
env:
104-
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
97+
RUSTDOCFLAGS: -Z unstable-options --generate-link-to-definition --cfg=docsrs -D warnings
10598

10699
audit:
107100
runs-on: ubuntu-latest
108101
steps:
109102
- uses: actions/checkout@v4
110-
111-
- name: Setup Rust
112-
uses: ./.github/actions/setup-rust
113-
with:
114-
key: audit
115-
toolchain: stable
116-
117-
- name: Install cargo-audit
118-
uses: taiki-e/install-action@v2
119-
with:
120-
tool: cargo-audit
121-
122-
- name: Run audit
123-
run: cargo audit --deny warnings
103+
- uses: EmbarkStudios/cargo-deny-action@v2
124104

125105
api-powerset:
106+
strategy:
107+
matrix:
108+
toolchain:
109+
- 1.73
126110
runs-on: ubuntu-latest
127111
steps:
128112
- uses: actions/checkout@v4
129-
130-
- name: Setup Rust
131-
uses: ./.github/actions/setup-rust
113+
- uses: dtolnay/rust-toolchain@master
132114
with:
133-
key: api-powerset
134-
toolchain: stable
135-
115+
toolchain: ${{ matrix.toolchain }}
136116
- name: Install cargo-hack
137117
uses: taiki-e/install-action@v2
138118
with:
139119
tool: cargo-hack
140-
141120
- name: Check powerset
142121
run: cargo hack check --feature-powerset --package zipsign-api
143122
env:
@@ -151,18 +130,16 @@ jobs:
151130
os:
152131
- ubuntu-22.04
153132
- windows-2022
154-
- macos-12
133+
- macos-13
155134
versions:
156135
- ""
157136
- "-Zminimal-versions"
158137
runs-on: ${{ matrix.os }}
159138
steps:
160139
- uses: actions/checkout@v4
161140

162-
- name: Setup Rust
163-
uses: ./.github/actions/setup-rust
141+
- uses: dtolnay/rust-toolchain@master
164142
with:
165-
key: execute${{ matrix.versions }}
166143
toolchain: ${{ matrix.toolchain }}
167144

168145
- name: Update lockfile
@@ -187,15 +164,17 @@ jobs:
187164
zipsign unsign zip Cargo.lock.zip
188165
189166
semver-checks:
167+
strategy:
168+
matrix:
169+
toolchain:
170+
- stable
190171
runs-on: ubuntu-latest
191172
steps:
192173
- uses: actions/checkout@v4
193174

194-
- name: Setup Rust
195-
uses: ./.github/actions/setup-rust
175+
- uses: dtolnay/rust-toolchain@master
196176
with:
197-
key: semver-checks
198-
toolchain: stable
177+
toolchain: ${{ matrix.toolchain }}
199178

200179
- name: Install cargo-semver-checks
201180
uses: taiki-e/install-action@v2
@@ -207,20 +186,44 @@ jobs:
207186
- run: cargo semver-checks -p zipsign-api --all-features
208187

209188
public-api:
189+
strategy:
190+
matrix:
191+
toolchain:
192+
- nightly
210193
runs-on: ubuntu-latest
211194
steps:
212195
- uses: actions/checkout@v4
213196

214-
- name: Setup Rust
215-
uses: ./.github/actions/setup-rust
197+
- uses: dtolnay/rust-toolchain@master
216198
with:
217-
key: public-api
218-
toolchain: nightly
199+
toolchain: ${{ matrix.toolchain }}
219200

220201
- name: Install cargo-public-api
221202
uses: taiki-e/install-action@v2
222203
with:
223204
tool: cargo-public-api
224205

225206
- run: cargo public-api -p zipsign-api
207+
working-directory: api
226208
- run: cargo public-api -p zipsign-api diff
209+
working-directory: api
210+
211+
sort:
212+
name: Check order in Cargo.toml
213+
runs-on: ubuntu-latest
214+
steps:
215+
- uses: actions/checkout@v4
216+
217+
- uses: dtolnay/rust-toolchain@master
218+
with:
219+
toolchain: stable
220+
221+
- run: cargo install --git https://github.com/DevinR528/cargo-sort.git --rev 3701753667c5d47ae166d6e5cd7a11384e068ed0
222+
223+
- run: cargo sort --workspace --grouped --check --check-format
224+
225+
typos:
226+
runs-on: ubuntu-latest
227+
steps:
228+
- uses: actions/checkout@v4
229+
- uses: crate-ci/typos@master

Cargo.toml

+15-14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ edition = "2021"
66
authors = ["René Kijewski <[email protected]>"]
77
repository = "https://github.com/Kijewski/zipsign"
88
license = "Apache-2.0 WITH LLVM-exception"
9+
rust-version = "1.81"
10+
11+
[package.metadata.docs.rs]
12+
all-features = true
13+
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
14+
15+
[dependencies]
16+
clap.workspace = true
17+
ed25519-dalek = { workspace = true, features = ["rand_core"] }
18+
normalize-path.workspace = true
19+
pretty-error-debug.workspace = true
20+
rand_core.workspace = true
21+
tempfile.workspace = true
22+
thiserror.workspace = true
23+
zipsign-api.workspace = true
924

1025
[workspace]
1126
resolver = "2"
@@ -28,17 +43,3 @@ version = "0.1.2"
2843
path = "api"
2944
default-features = false
3045
features = ["tar", "zip"]
31-
32-
[dependencies]
33-
clap.workspace = true
34-
ed25519-dalek = { workspace = true, features = ["rand_core"] }
35-
normalize-path.workspace = true
36-
pretty-error-debug.workspace = true
37-
rand_core.workspace = true
38-
tempfile.workspace = true
39-
thiserror.workspace = true
40-
zipsign-api.workspace = true
41-
42-
[package.metadata.docs.rs]
43-
all-features = true
44-
rustdoc-args = ["--cfg", "docsrs"]

_typos.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[default]
2+
locale = "en-us"
3+
4+
[files]
5+
extend-exclude = ["/.*"]

api/Cargo.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ edition = "2021"
66
authors = ["René Kijewski <[email protected]>"]
77
repository = "https://github.com/Kijewski/zipsign"
88
license = "Apache-2.0 WITH LLVM-exception"
9+
rust-version = "1.73"
10+
11+
[package.metadata.docs.rs]
12+
all-features = true
13+
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
914

1015
[dependencies]
1116
base64 = { workspace = true, optional = true }
@@ -27,7 +32,3 @@ sign-zip = ["dep:zip"]
2732

2833
tar = ["sign-tar", "unsign-tar", "verify-tar"]
2934
zip = ["sign-zip", "unsign-zip", "verify-zip"]
30-
31-
[package.metadata.docs.rs]
32-
all-features = true
33-
rustdoc-args = ["--cfg", "docsrs"]

api/src/constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// "\x0c\x04\x01" -- form feed, end of text, start of header
22
// "ed25519ph" -- used algorithm
33
// "\x00\x00" -- version number in network byte order
4-
/// Bytes preceeding signatures
4+
/// Bytes preceding signatures
55
pub(crate) const MAGIC_HEADER: &[u8; 14] = b"\x0c\x04\x01ed25519ph\x00\x00";
66

77
/// Total number of bytes in a [`MAGIC_HEADER`] + [`SignatureCountLeInt`]

api/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(docsrs, feature(doc_cfg))]
1+
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
22
#![forbid(unsafe_code)]
33
#![allow(unknown_lints)]
44
#![warn(absolute_paths_not_starting_with_crate)]
@@ -108,7 +108,7 @@ pub enum ZipsignError {
108108
#[cfg(feature = "verify-tar")]
109109
#[cfg_attr(docsrs, doc(cfg(feature = "verify-tar")))]
110110
VerifyTar(#[from] self::verify::VerifyTarError),
111-
/// An error retuned by [`verify_zip()`][self::verify::verify_zip]
111+
/// An error returned by [`verify_zip()`][self::verify::verify_zip]
112112
#[cfg(feature = "verify-zip")]
113113
#[cfg_attr(docsrs, doc(cfg(feature = "verify-zip")))]
114114
VerifyZip(#[from] self::verify::VerifyZipError),

api/src/verify/zip.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::{NoMatch, ReadSignaturesError, VerifyingKey, find_match, read_signatu
66
use crate::{Prehash, Signature};
77

88
crate::Error! {
9-
/// An error retuned by [`verify_zip()`]
9+
/// An error returned by [`verify_zip()`]
1010
pub struct VerifyZipError(Error) {
1111
#[error("could not read input")]
1212
InputRead(#[source] std::io::Error),

0 commit comments

Comments
 (0)