Files
cool_fox/.github/workflows/ci.yml

69 lines
2.2 KiB
YAML

name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v5
# The version and components pinned in rust-toolchain.toml.
- run: rustup toolchain install
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Clippy, diagnostics build
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
# Includes xtask's repository_passes_policy, the asset-policy check.
- name: Tests
run: cargo test --workspace --locked
# The flake's dev shell and the portable crates through it: keeps the NixOS
# instructions honest and catches a stale flake.lock.
nix:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v32
with:
extra_nix_config: |
experimental-features = nix-command flakes
extra-substituters = https://nix-community.cachix.org
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
- name: Dev shell and platform-independent tests
run: >-
nix develop --command cargo test --locked
-p victory-core -p victory-formats -p victory-pipeline
-p victory-shader -p victory-game -p xtask
# The crates that do not need Windows or D3D12, tested on Linux: a quicker
# signal, and a check that they stay portable. victory-pe is left out
# because its tests parse their own test executable as a PE image.
portable:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- run: rustup toolchain install
- uses: Swatinem/rust-cache@v2
- name: Tests (platform-independent crates)
run: >-
cargo test --locked
-p victory-core -p victory-formats -p victory-pipeline
-p victory-shader -p victory-game -p xtask