| 1 |
on: |
| 2 |
push: |
| 3 |
branches: [ master ] |
| 4 |
pull_request: |
| 5 |
branches: [ master ] |
| 6 |
|
| 7 |
name: Continuous integration |
| 8 |
|
| 9 |
env: |
| 10 |
CARGO_TERM_COLOR: always |
| 11 |
CARGO_INCREMENTAL: 0 |
| 12 |
|
| 13 |
jobs: |
| 14 |
tests: |
| 15 |
runs-on: ubuntu-latest |
| 16 |
continue-on-error: ${{ matrix.experimental }} |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
include: |
| 20 |
- rust: 1.51.0 # MSRV |
| 21 |
features: serde |
| 22 |
experimental: false |
| 23 |
- rust: 1.70.0 |
| 24 |
features: serde |
| 25 |
experimental: false |
| 26 |
- rust: stable |
| 27 |
features: |
| 28 |
bench: true |
| 29 |
experimental: false |
| 30 |
- rust: beta |
| 31 |
features: serde |
| 32 |
experimental: false |
| 33 |
- rust: nightly |
| 34 |
features: serde, borsh, zeroize |
| 35 |
experimental: false |
| 36 |
|
| 37 |
steps: |
| 38 |
- uses: actions/checkout@v4 |
| 39 |
- uses: dtolnay/rust-toolchain@master |
| 40 |
with: |
| 41 |
toolchain: ${{ matrix.rust }} |
| 42 |
- name: Pin versions for MSRV |
| 43 |
if: "${{ matrix.rust == '1.51.0' }}" |
| 44 |
run: | |
| 45 |
cargo update -p serde_test --precise 1.0.163 |
| 46 |
cargo update -p serde --precise 1.0.69 |
| 47 |
- name: Build |
| 48 |
run: | |
| 49 |
cargo build -v --no-default-features |
| 50 |
cargo build --verbose --features "${{ matrix.features }}" |
| 51 |
- name: Tests |
| 52 |
run: | |
| 53 |
cargo doc --verbose --features "${{ matrix.features }}" --no-deps |
| 54 |
cargo test --verbose --features "${{ matrix.features }}" |
| 55 |
cargo test --release --verbose --features "${{ matrix.features }}" |
| 56 |
- name: Test run benchmarks |
| 57 |
if: matrix.bench != '' |
| 58 |
run: cargo test -v --benches |
| 59 |
|
| 60 |
nostd: |
| 61 |
runs-on: ubuntu-latest |
| 62 |
continue-on-error: false |
| 63 |
strategy: |
| 64 |
matrix: |
| 65 |
include: |
| 66 |
- rust: stable |
| 67 |
target: thumbv6m-none-eabi |
| 68 |
features: zeroize |
| 69 |
|
| 70 |
name: nostd/${{ matrix.target }}/${{ matrix.rust }} |
| 71 |
steps: |
| 72 |
- uses: actions/checkout@v4 |
| 73 |
- uses: dtolnay/rust-toolchain@stable |
| 74 |
with: |
| 75 |
toolchain: ${{ matrix.rust }} |
| 76 |
targets: ${{ matrix.target }} |
| 77 |
- name: Tests |
| 78 |
run: | |
| 79 |
cargo rustc "--target=${{ matrix.target }}" --no-default-features --features "${{ matrix.features }}" |
| 80 |
|
| 81 |
|
| 82 |
miri: |
| 83 |
runs-on: ubuntu-latest |
| 84 |
steps: |
| 85 |
- uses: actions/checkout@v4 |
| 86 |
- name: Install Miri |
| 87 |
run: | |
| 88 |
rustup toolchain install nightly --component miri |
| 89 |
rustup override set nightly |
| 90 |
cargo miri setup |
| 91 |
- name: Test with Miri |
| 92 |
run: cargo miri test --all-features |