-
Notifications
You must be signed in to change notification settings - Fork 17
104 lines (101 loc) · 3.45 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
env:
CARGO_TERM_COLOR: always
jobs:
test:
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
- 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 }} conv2_direct -- --format=terse
- 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 }} conv2_direct -- --format=terse
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install wasm-pack
run: cargo install wasm-pack -vv
- name: wasm test
run: wasm-pack test --headless --firefox -- --no-default-features -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@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 --all-features -- -D warnings
- name: rustdoc
if: ${{ !cancelled() }}
run: cargo rustdoc --all-features -- --D warnings