-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.86 KB
/
build.yml
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
---
name: Build
on: [push, pull_request]
jobs:
cargo-toml-features:
name: Generate Feature Combinations
runs-on: ubuntu-latest
outputs:
feature-combinations: ${{ steps.cargo-toml-features.outputs.feature-combinations }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Determine Cargo Features
id: cargo-toml-features
uses: Holzhaus/cargo-toml-features-action@3afa751aae4071b2d1ca1c5fa42528a351c995f4
build:
needs: cargo-toml-features
runs-on: ubuntu-latest
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@v4
- name: Print Rust version
run: rustc -vV
- name: Build Package
run: 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
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Publish Package
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}