krnlc #40
This file contains 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 | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: 1 | |
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@v2 | |
- name: cargo fetch | |
run: cargo fetch --target ${{ matrix.target }} | |
- name: build | |
if: ${{ !cancelled() }} | |
run: cargo build --all-features --all-targets | |
- name: build examples | |
if: ${{ !cancelled() }} | |
run: cargo build -p neural-network-mnist-example | |
- name: build benches | |
if: ${{ !cancelled() }} | |
run: cargo build -p neural-network-benches --benches | |
- name: test | |
if: ${{ !cancelled() }} | |
run: cargo test --no-default-features --features "serde neural-network" -- --format=terse | |
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@v2 | |
- 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@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: fmt | |
if: ${{ !cancelled() }} | |
run: cargo fmt --all -- --check | |
- name: clippy | |
if: ${{ !cancelled() }} | |
run: cargo clippy --no-default-features --features "neural-network" -- -D warnings | |
- name: rustdoc | |
run: cargo rustdoc --all-features -- --D warnings |