Skip to content

Commit 3f27a0f

Browse files
committed
chore: add github actions
1 parent 7fd1a27 commit 3f27a0f

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on: [pull_request, push]
4+
5+
# Cancel a job if there's a new on on the same branch started.
6+
# Based on https://stackoverflow.com/questions/58895283/stop-already-running-workflow-job-in-github-actions/67223051#67223051
7+
concurrency:
8+
group: ${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
CARGO_INCREMENTAL: 0
13+
RUST_BACKTRACE: 1
14+
# Faster crates.io index checkout.
15+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
16+
RUST_LOG: debug
17+
18+
jobs:
19+
check_clippy:
20+
runs-on: ubuntu-24.04
21+
name: Clippy
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Install required packages
25+
run: sudo apt install --no-install-recommends --yes libhwloc-dev ocl-icd-opencl-dev
26+
- name: Run cargo clippy
27+
run: cargo clippy --all-targets --workspace -- -D warnings
28+
29+
check_fmt:
30+
runs-on: ubuntu-24.04
31+
name: Checking fmt
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Run cargo fmt
35+
run: cargo fmt --all -- --check
36+
37+
build_gpu:
38+
runs-on: ubuntu-24.04
39+
name: Build with various GPU support enabled
40+
env:
41+
RUST_LOG: trace
42+
# Build the kernel only for the single architecture . This should reduce
43+
# the overall compile-time significantly.
44+
EC_GPU_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
45+
BELLMAN_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
46+
NEPTUNE_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Install required packages
50+
run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
51+
# Run clippy as apart of the test job as it also needs the nvidia toolkit
52+
# in order to compile
53+
- name: Run Clippy
54+
run: cargo clippy --workspace -- -D warnings
55+
- name: Build it
56+
run: cargo build --verbose
57+
58+
test_gpu:
59+
runs-on: ubuntu-24.04
60+
name: Test on GPUs
61+
env:
62+
RUST_LOG: trace
63+
# Build the kernel only for the single architecture . This should reduce
64+
# the overall compile-time significantly.
65+
EC_GPU_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
66+
BELLMAN_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
67+
NEPTUNE_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Install required packages
71+
run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
72+
# Run clippy as apart of the test job as it also needs the nvidia toolkit
73+
# in order to compile
74+
- name: Run Clippy
75+
run: cargo clippy --workspace -- -D warnings
76+
- name: Test with CUDA
77+
run: cargo test --verbose
78+
79+
test_macos:
80+
runs-on: macos-latest
81+
name: Test in release mode on MacOS
82+
steps:
83+
- uses: actions/checkout@v4
84+
- name: Install required packages
85+
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install hwloc
86+
87+
- name: Run usual tests in release profile
88+
# CUDA isn't support on MacOS, hence only enable OpenCL.
89+
run: cargo test --verbose --release --no-default-features -- --nocapture

0 commit comments

Comments
 (0)