| 1 |
name: Rust |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ main ] |
| 6 |
pull_request: |
| 7 |
branches: [ main ] |
| 8 |
|
| 9 |
env: |
| 10 |
CARGO_TERM_COLOR: always |
| 11 |
|
| 12 |
jobs: |
| 13 |
build: |
| 14 |
runs-on: ${{matrix.os}} |
| 15 |
strategy: |
| 16 |
matrix: |
| 17 |
os: |
| 18 |
- macos-latest |
| 19 |
- ubuntu-latest |
| 20 |
- windows-latest |
| 21 |
toolchain: |
| 22 |
- stable |
| 23 |
- 1.82.0 |
| 24 |
include: |
| 25 |
- os: macos-latest |
| 26 |
target: x86_64-apple-darwin |
| 27 |
- os: ubuntu-latest |
| 28 |
target: x86_64-unknown-linux-gnu |
| 29 |
- os: windows-latest |
| 30 |
target: x86_64-pc-windows-msvc |
| 31 |
steps: |
| 32 |
- uses: actions/checkout@v4 |
| 33 |
- name: Install rust version |
| 34 |
uses: dtolnay/rust-toolchain@stable |
| 35 |
with: |
| 36 |
toolchain: ${{matrix.toolchain}} |
| 37 |
target: ${{matrix.target}} |
| 38 |
- uses: actions/checkout@v4 |
| 39 |
- name: Build (default) |
| 40 |
run: cargo build --workspace |
| 41 |
- name: Run tests (default) |
| 42 |
run: cargo test --workspace |
| 43 |
- name: Build (unstable-tagged-offsets) |
| 44 |
run: cargo build --workspace --features unstable-tagged-offsets |
| 45 |
- name: Run tests (unstable-tagged-offsets) |
| 46 |
run: cargo test --workspace --features unstable-tagged-offsets |
| 47 |
|
| 48 |
build-wasm: |
| 49 |
runs-on: ${{matrix.os}} |
| 50 |
strategy: |
| 51 |
matrix: |
| 52 |
os: |
| 53 |
- ubuntu-latest |
| 54 |
toolchain: |
| 55 |
- stable |
| 56 |
- 1.82.0 |
| 57 |
include: |
| 58 |
- os: ubuntu-latest |
| 59 |
target: wasm32-unknown-unknown |
| 60 |
steps: |
| 61 |
- uses: actions/checkout@v4 |
| 62 |
- name: Install rust version |
| 63 |
uses: dtolnay/rust-toolchain@stable |
| 64 |
with: |
| 65 |
toolchain: ${{matrix.toolchain}} |
| 66 |
target: ${{matrix.target}} |
| 67 |
- uses: actions/checkout@v4 |
| 68 |
- name: Build (default) |
| 69 |
run: cargo build --target wasm32-unknown-unknown |
| 70 |
- name: Build (unstable-tagged-offsets) |
| 71 |
run: cargo build --target wasm32-unknown-unknown --features unstable-tagged-offsets |
| 72 |
|
| 73 |
rustfmt: |
| 74 |
name: Rustfmt |
| 75 |
runs-on: ubuntu-24.04 |
| 76 |
steps: |
| 77 |
- name: Checkout code |
| 78 |
uses: actions/checkout@v4 |
| 79 |
- name: Setup Rust toolchain |
| 80 |
uses: dtolnay/rust-toolchain@v1 |
| 81 |
with: |
| 82 |
toolchain: nightly |
| 83 |
components: rustfmt |
| 84 |
- name: Cache build artifacts |
| 85 |
uses: Swatinem/[email protected] |
| 86 |
- name: Check code formatted |
| 87 |
run: cargo fmt --all -- --check |
| 88 |
|
| 89 |
clippy: |
| 90 |
name: Clippy |
| 91 |
runs-on: ubuntu-24.04 |
| 92 |
steps: |
| 93 |
- name: Checkout code |
| 94 |
uses: actions/checkout@v4 |
| 95 |
- name: Setup Rust toolchain |
| 96 |
uses: dtolnay/rust-toolchain@v1 |
| 97 |
with: |
| 98 |
toolchain: stable |
| 99 |
components: clippy |
| 100 |
- name: Cache build artifacts |
| 101 |
uses: Swatinem/[email protected] |
| 102 |
|
| 103 |
- name: Check no lint warnings |
| 104 |
run: cargo clippy --workspace -- -D warnings |
| 105 |
- name: Check no lint warnings (all features) |
| 106 |
run: cargo clippy --workspace --all-features -- -D warnings |
| 107 |
- name: Check no lint warnings (no default features) |
| 108 |
run: cargo clippy --workspace --no-default-features -- -D warnings |