Skip to content

Commit 4112af7

Browse files
committed
chore: use GitHub Actions for CI
Remove the CircleCI config.
1 parent b125d47 commit 4112af7

File tree

2 files changed

+87
-193
lines changed

2 files changed

+87
-193
lines changed

.circleci/config.yml

Lines changed: 0 additions & 193 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
17+
jobs:
18+
set-msrv:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
msrv: ${{ steps.msrv.outputs.MSRV }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Get MSRV from rust-toolchain
25+
id: msrv
26+
run: |
27+
MSRV=$(cat ./rust-toolchain)
28+
echo "MSRV=$MSRV" | tee --append "$GITHUB_OUTPUT"
29+
30+
linux:
31+
needs: set-msrv
32+
runs-on: ubuntu-latest
33+
name: Build and test
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dtolnay/rust-toolchain@master
37+
with:
38+
toolchain: ${{needs.set-msrv.outputs.msrv}}
39+
- name: Install required packages
40+
run: sudo apt install --no-install-recommends --yes ocl-icd-opencl-dev nvidia-cuda-toolkit
41+
- name: Build with default features
42+
run: cargo build --workspace
43+
# Machine has no GPU installed, hence run without the `cuda` or `opencl` feature.
44+
- name: Run tests without default features
45+
run: cargo test --workspace --no-default-features -- --nocapture
46+
47+
clippy_check:
48+
needs: set-msrv
49+
runs-on: ubuntu-latest
50+
name: Clippy
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: dtolnay/rust-toolchain@master
54+
with:
55+
toolchain: ${{ needs.set-msrv.outputs.msrv }}
56+
components: clippy
57+
- name: Install required packages
58+
run: sudo apt install --no-install-recommends --yes ocl-icd-opencl-dev nvidia-cuda-dev
59+
- name: Run cargo clippy default features
60+
run: cargo clippy --workspace --all-targets -- -D warnings
61+
- name: Run cargo clippy with cuda and opencl features
62+
run: cargo clippy --workspace --all-targets --features cuda,opencl -- -D warnings
63+
- name: Run cargo clippy with cuda feature
64+
run: cargo clippy --workspace --all-targets --no-default-features --features cuda -- -D warnings
65+
- name: Run cargo clippy with opencl feature
66+
run: cargo clippy --workspace --all-targets --no-default-features --features opencl -- -D warnings
67+
68+
check_fmt_and_docs:
69+
needs: set-msrv
70+
runs-on: ubuntu-latest
71+
name: Checking fmt and docs
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: dtolnay/rust-toolchain@master
75+
with:
76+
toolchain: ${{ needs.set-msrv.outputs.msrv }}
77+
components: rustfmt
78+
- name: fmt
79+
run: cargo fmt --all -- --check
80+
- name: Docs
81+
env:
82+
# Making sure that the documentation can be built without having the NVIDIA toolkit
83+
# installed.
84+
DOCS_RS: true
85+
run: |
86+
cargo rustdoc --package ec-gpu --all-features -- -D warnings
87+
cargo rustdoc --package ec-gpu-gen --all-features -- -D warnings

0 commit comments

Comments
 (0)