-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (75 loc) · 2.67 KB
/
test-check-lint.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
name: Test-Check-Lint
on:
workflow_call:
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format-code:
name: Check Code
runs-on: nvidia-nc4as-t4
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
PATH: ${{ github.workspace }}/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout Code Format
uses: actions/checkout@v3
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal
- name: Install Dependencies
run: rustup component add rustfmt
- name: Run Code Format
run: cargo fmt --all -- --config imports_granularity=Crate,group_imports=One --check
clippy-code:
name: Clippy Code
runs-on: nvidia-nc4as-t4
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
PATH: ${{ github.workspace }}/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install stable toolchain
run: |
curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal
rustup component add clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
test-cpu:
name: Test the CPU backend
runs-on: nvidia-nc4as-t4
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
PATH: ${{ github.workspace }}/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal
- name: Run CPU test
run: cargo test --features cpu
test-gpu:
name: Test the GPU backend
runs-on: nvidia-nc4as-t4
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
PATH: ${{ github.workspace }}/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
run: curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal
- name: Install Dependencies
run: |
export DEBIAN_FRONTEND=non-interactive
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install -y nvidia-open-560
- name: Run GPU test
run: cargo test --features gpu