Skip to content

Update CI script (#71) #243

Update CI script (#71)

Update CI script (#71) #243

Workflow file for this run

name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
# Just test windows as several of the profilers don't do anything or fail to build on other platforms
jobs:
build:
strategy:
matrix:
toolchain: [stable, beta, 1.70.0]
os: [windows-2022, ubuntu-22.04, macos-12]
exclude:
- os: macos-12
toolchain: beta
- os: windows-2022
toolchain: beta
- os: macos-12
toolchain: 1.70.0
- os: windows-2022
toolchain: 1.70.0
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Build (puffin)
run: cargo build --package=profiling --features=profile-with-puffin
- name: Build (superluminal)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-superluminal
- name: Build (optick)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-optick
- name: Build (tracing)
run: cargo build --package=profiling --features=profile-with-tracing
- name: Build (tracy)
run: cargo build --package=profiling --features=profile-with-tracy
- name: Build (type-check)
run: cargo build --package=profiling --features=type-check
# Only do this on windows, some of the profilers only support windows
- name: Run tests
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo test --workspace
# Test that we compile with no default features enabled
- name: Build without default features
run: cargo build --no-default-features
build-demo:
strategy:
matrix:
toolchain: [stable, beta]
os: [windows-2022, ubuntu-22.04, macos-12]
exclude:
- os: macos-12
toolchain: beta
- os: windows-2022
toolchain: beta
runs-on: ${{ matrix.os }}
needs: build
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Build (demo-puffin)
working-directory: ./demo-puffin
run: cargo build --package=demo-puffin
deny-check:
name: cargo-deny
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
- uses: EmbarkStudios/cargo-deny-action@v1
with:
manifest-path: demo-puffin/Cargo.toml
command: check ${{ matrix.checks }}
clean:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check the format
run: cargo fmt --all -- --check
- name: Run clippy (puffin)
run: >
cargo clippy
--package=profiling
--features profile-with-puffin
- name: Run clippy (optick)
run: >
cargo clippy
--package=profiling
--features profile-with-optick
- name: Run clippy (superluminal)
run: >
cargo clippy
--package=profiling
--features profile-with-superluminal
- name: Run clippy (tracing)
run: >
cargo clippy
--package=profiling
--features profile-with-tracing
- name: Run clippy (tracy)
run: >
cargo clippy
--package=profiling
--features profile-with-tracy
- name: Run clippy (type-check)
run: >
cargo clippy
--package=profiling
--features type-check
- name: Run clippy (demo-puffin)
working-directory: ./demo-puffin
run: >
cargo clippy
--package=demo-puffin