Skip to content

ci cargo-hack clippy + msrv #95

ci cargo-hack clippy + msrv

ci cargo-hack clippy + msrv #95

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- "**"
paths-ignore:
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: build
if: ${{ !cancelled() }}
run: cargo build --all-features --all-targets -p autograph -p neural-network-mnist-example -v
- name: build benches
if: ${{ !cancelled() }}
run: cargo build -p neural-network-benches --benches -v
- name: test
if: ${{ !cancelled() }}
run: cargo test --workspace --no-default-features --features "serde neural-network mnist" -v
- name: test avx
env:
RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+avx
run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct
- name: test fma
env:
RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+fma
run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct
careful:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: install cargo-careful
if: ${{ !cancelled() }}
run: cargo +nightly install cargo-careful
- name: careful test
if: ${{ !cancelled() }}
run: cargo +nightly careful test --test=integration_tests --no-default-features --features neural-network -v
- name: careful test single-thread
env:
RAYON_NUM_THREADS: 1
run: cargo +nightly careful test --test=integration_tests --no-default-features --features neural-network -v
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install wasm-pack
if: ${{ !cancelled() }}
run: cargo install wasm-pack -vv
- name: wasm test
if: ${{ !cancelled() }}
run: wasm-pack test --headless --firefox -- --no-default-features --features "serde neural-network" -vv
env:
RUSTFLAGS: --cfg run_in_browser
krnlc:
runs-on: ubuntu-latest
# spirv tools install copied from https://github.com/EmbarkStudios/rust-gpu/blob/main/.github/workflows/ci.yaml
env:
spirv_tools_version: "20221024"
spirv_tools_linux_url: "https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1863/20221024-094528/install.tgz"
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-05-27
components: rust-src, rustc-dev, llvm-tools-preview
- name: Install spirv-tools
run: |
sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
mkdir "${HOME}/spirv-tools"
curl -fL "$spirv_tools_linux_url" | tar -xz -C "${HOME}/spirv-tools"
echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH
- name: Install krnlc
run: cargo +nightly-2023-05-27 install krnlc --git="https://github.com/charles-r-earp/krnl" --locked -v --no-default-features --features use-installed-tools
- name: krnlc
run: krnlc -p autograph -v --check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: fmt
if: ${{ !cancelled() }}
run: cargo fmt --check
- name: install cargo-hack
if: ${{ !cancelled() }}
run: cargo install cargo-hack -v
- name: clippy
if: ${{ !cancelled() }}
run: cargo hack --feature-powerset --workspace --exclude-features "cuda tch" --keep-going clippy --all-targets -- -D warnings
- name: rustdoc
if: ${{ !cancelled() }}
run: cargo rustdoc --all-features -- --D warnings
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
- name: msrv
if: ${{ !cancelled() }}
run: |
cargo +nightly generate-lockfile -Zmsrv-policy
cat Cargo.lock
cargo +1.70.0 check --workspace --features serde --all-targets -v
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1