Skip to content

Add simple example to ci #288

Add simple example to ci

Add simple example to ci #288

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]
os: [windows-2022, ubuntu-22.04, macos-12]
exclude:
- os: macos-12
toolchain: beta
- os: windows-2022
toolchain: beta
runs-on: ${{ matrix.os }}
needs: [clean, check-msrv]
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 (puffin example)
run: cargo build --package=profiling --features=profile-with-puffin --example=simple
- name: Build (superluminal)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-superluminal
- name: Build (superluminal example)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-superluminal --example=simple
- name: Build (optick)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-optick
- name: Build (optick example)
if: ${{ runner.os == 'Windows' && matrix.toolchain == 'stable' }}
run: cargo build --package=profiling --features=profile-with-optick --example=simple
- name: Build (tracing)
run: cargo build --package=profiling --features=profile-with-tracing
- name: Build (tracing example)
run: cargo build --package=profiling --features=profile-with-tracing --example=simple
- name: Build (tracy)
run: cargo build --package=profiling --features=profile-with-tracy
- name: Build (tracy example)
run: cargo build --package=profiling --features=profile-with-tracy --example=simple
- name: Build (type-check)
run: cargo build --package=profiling --features=type-check
- name: Build (type-check example)
run: cargo build --package=profiling --features=type-check --example=simple
# 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 }}
check-msrv:
runs-on: ubuntu-22.04
strategy:
matrix:
config:
- package: profiling
msrv: '1.60'
extra-args: --no-default-features
- package: profiling-procmacros
msrv: '1.65'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.config.msrv }}
- uses: Swatinem/rust-cache@v2
# Running cargo check should be enough to find MSRV problems
- name: Verify MSRV
run: >
cargo check
-p ${{ matrix.config.package }}
${{ matrix.config.extra-args }}
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