-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (64 loc) · 2.6 KB
/
Copy pathbuild.yml
File metadata and controls
67 lines (64 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: Build
on: [push, pull_request]
permissions: {}
jobs:
cargo-toml-features:
name: Generate Feature Combinations
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
feature-combinations: ${{ steps.cargo-toml-features.outputs.feature-combinations }}
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Determine Cargo Features
id: cargo-toml-features
uses: Holzhaus/cargo-toml-features-action@3afa751aae4071b2d1ca1c5fa42528a351c995f4
build:
needs: cargo-toml-features
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
features: ${{ fromJson(needs.cargo-toml-features.outputs.feature-combinations) }}
env:
CRATE_FEATURES: ${{ join(matrix.features, ',') }}
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Print Rust version
run: rustc -vV
- name: Build Package
run: | # zizmor: ignore[use-trusted-publishing]
cargo publish --dry-run --locked --no-default-features --features "${CRATE_FEATURES}"
- name: Run Tests
run: cargo test --locked --no-default-features --features "${CRATE_FEATURES}"
- name: Run Benchmark
run: cargo bench --locked --no-default-features --features "${CRATE_FEATURES}"
- name: Generate Documentation
run: cargo doc --no-deps --locked --no-default-features --features "${CRATE_FEATURES}"
publish:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC token exchange
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Authenticate with registry
id: auth
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe
- name: Publish Package
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}