75 lines
2.7 KiB
YAML
75 lines
2.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, development]
|
|
pull_request:
|
|
branches: [development]
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: "${{ matrix.platform.os }}-latest"
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
[
|
|
{ os: "windows", target: "x86_64-pc-windows-msvc" },
|
|
{ os: "windows", target: "i686-pc-windows-msvc" },
|
|
{ os: "ubuntu", target: "x86_64-unknown-linux-gnu" },
|
|
{ os: "ubuntu", target: "i686-unknown-linux-gnu" },
|
|
{ os: "ubuntu", target: "wasm32-unknown-unknown" },
|
|
{ os: "macos", target: "aarch64-apple-darwin" },
|
|
]
|
|
env:
|
|
TZ: "/usr/share/zoneinfo/your/location"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Cache .cargo and target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo
|
|
./target
|
|
key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.toml') }}
|
|
restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }}
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.platform.target }}
|
|
- name: Install test runner for wasm
|
|
if: matrix.platform.target == 'wasm32-unknown-unknown'
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
- name: Stable Build with all features
|
|
run: cargo build --all-features --target ${{ matrix.platform.target }}
|
|
- name: Stable Build without features
|
|
run: cargo build --target ${{ matrix.platform.target }}
|
|
- name: Tests
|
|
if: matrix.platform.target == 'x86_64-unknown-linux-gnu' || matrix.platform.target == 'x86_64-pc-windows-msvc' || matrix.platform.target == 'aarch64-apple-darwin'
|
|
run: cargo test --all-features
|
|
- name: Tests in WASM
|
|
if: matrix.platform.target == 'wasm32-unknown-unknown'
|
|
run: wasm-pack test --node -- --all-features
|
|
|
|
check_features:
|
|
runs-on: "${{ matrix.platform.os }}-latest"
|
|
strategy:
|
|
matrix:
|
|
platform: [{ os: "ubuntu" }]
|
|
features: ["--features serde", "--features datasets", ""]
|
|
env:
|
|
TZ: "/usr/share/zoneinfo/your/location"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Cache .cargo and target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo
|
|
./target
|
|
key: ${{ runner.os }}-cargo-features-${{ hashFiles('Cargo.toml') }}
|
|
restore-keys: ${{ runner.os }}-cargo-features
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
- name: Stable Build
|
|
run: cargo build --no-default-features ${{ matrix.features }}
|