2023-03-13 10:42:12 +00:00
|
|
|
name: Rust
|
2023-01-12 23:20:12 +05:30
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
2023-09-06 00:06:03 +02:00
|
|
|
feature-checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: taiki-e/install-action@cargo-hack
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
2024-02-05 10:59:39 -05:00
|
|
|
with:
|
|
|
|
workspaces: "./bindings/rust"
|
2023-09-06 00:06:03 +02:00
|
|
|
- name: cargo hack
|
|
|
|
working-directory: bindings/rust
|
|
|
|
run: cargo hack check --feature-powerset --depth 2
|
2024-02-06 19:39:07 +02:00
|
|
|
- name: Check that bindings are up to date
|
|
|
|
run: git diff --exit-code bindings/rust/src/bindings/generated.rs
|
2023-09-06 00:06:03 +02:00
|
|
|
|
2023-03-13 10:42:12 +00:00
|
|
|
tests:
|
2024-02-05 10:59:39 -05:00
|
|
|
runs-on: ${{ matrix.host }}
|
2023-04-05 13:33:37 -05:00
|
|
|
strategy:
|
2024-02-05 10:59:39 -05:00
|
|
|
fail-fast: false
|
2023-04-05 13:33:37 -05:00
|
|
|
matrix:
|
2024-02-05 10:59:39 -05:00
|
|
|
include:
|
|
|
|
- host: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
- host: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
- host: macos-14
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
- host: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
2023-01-12 23:20:12 +05:30
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-02-05 10:59:39 -05:00
|
|
|
|
2023-09-06 00:06:03 +02:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2024-02-05 10:59:39 -05:00
|
|
|
with:
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
|
|
- uses: taiki-e/setup-cross-toolchain-action@v1
|
|
|
|
with:
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
2023-09-06 00:06:03 +02:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
2024-02-05 10:59:39 -05:00
|
|
|
with:
|
|
|
|
workspaces: "./bindings/rust"
|
|
|
|
cache-on-failure: true
|
|
|
|
|
2023-10-18 13:31:55 -05:00
|
|
|
- name: Build and Test
|
2023-03-29 01:59:52 -05:00
|
|
|
working-directory: bindings/rust
|
2024-02-06 19:39:07 +02:00
|
|
|
run: cargo test --target ${{ matrix.target }} --features generate-bindings
|
|
|
|
- name: Check that bindings are up to date
|
|
|
|
run: git diff --exit-code bindings/rust/src/bindings/generated.rs
|
2023-03-29 01:59:52 -05:00
|
|
|
- name: Benchmark
|
|
|
|
working-directory: bindings/rust
|
2024-02-05 10:59:39 -05:00
|
|
|
run: cargo bench --target ${{ matrix.target }}
|