Update ci.yml #973
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
env: | |
# When changing this, also update the `rust-version` in the workspace `Cargo.toml` | |
RUST_MIN_VER: "1.88.0" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
rustfmt: | |
runs-on: ubuntu-latest | |
name: cargo fmt (1.88) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install MSRV toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_MIN_VER }} | |
components: rustfmt | |
- name: cargo fmt | |
run: cargo fmt --all --check | |
typos: | |
runs-on: ubuntu-latest | |
name: typos | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: crate-ci/typos@master | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, macos-14, ubuntu-22.04, windows-2022] | |
name: cargo clippy + test (1.88) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install MSRV toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_MIN_VER }} | |
components: clippy | |
- name: rustc/cargo versions | |
run: rustc -V && cargo -V | |
- name: cargo clippy | |
run: cargo clippy --all-targets --workspace -- -D warnings | |
- name: cargo test | |
run: cargo test --workspace --features test-with-crash-handler | |
- name: cargo test release | |
run: cargo test --workspace --release --features test-with-crash-handler | |
build-ios: | |
runs-on: macos-latest | |
name: cargo build + clippy (iOS, 1.88) | |
env: | |
RUSTFLAGS: -Dwarnings | |
IPHONEOS_DEPLOYMENT_TARGET: "15.0" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install MSRV toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_MIN_VER }} | |
components: clippy | |
targets: aarch64-apple-ios | |
- name: cargo build | |
run: cargo build --target aarch64-apple-ios --all-targets --workspace | |
- name: cargo clippy | |
run: cargo clippy --target aarch64-apple-ios --all-targets --workspace | |
build-musl: | |
runs-on: ubuntu-latest | |
name: cargo build + test (musl, 1.88) | |
env: | |
RUSTFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install MSRV toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_MIN_VER }} | |
components: clippy | |
targets: x86_64-unknown-linux-musl | |
- name: Install musl tools | |
run: sudo apt-get install -y musl-tools | |
- name: cargo build | |
run: cargo build --target x86_64-unknown-linux-musl --all-targets --workspace | |
- name: cargo clippy | |
run: cargo clippy --target x86_64-unknown-linux-musl --all-targets --workspace | |
- name: cargo test | |
run: cargo test --target x86_64-unknown-linux-musl --workspace --features test-with-crash-handler | |
build-msrv: | |
runs-on: ubuntu-latest | |
name: cargo build (MSRV 1.88) | |
env: | |
RUSTFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install MSRV toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_MIN_VER }} | |
- name: rustc/cargo versions | |
run: rustc -V && cargo -V | |
- name: cargo build | |
run: cargo build | |
build-doc: | |
name: cargo docs-rs (nightly) | |
runs-on: ubuntu-22.04 | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
# Compile cargo-docs-rs locally so it links against the runner's glibc. | |
- run: cargo install cargo-docs-rs --locked | |
- run: cargo docs-rs -p flecs_ecs | |
- run: cargo docs-rs -p flecs_ecs_derive |