-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from lambdaclass/add_ci
Add CI file
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
compile: | ||
name: Compile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run cargo check | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
command: check | ||
|
||
- name: Check benchmarks | ||
run: cargo bench --no-run | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run clippy | ||
run: make clippy | ||
test: | ||
name: Test (Ubuntu) | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Run tests and generate code coverage | ||
run: cargo llvm-cov --lcov --output-path lcov.info | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: lcov.info | ||
fail_ci_if_error: true | ||
test_macos: | ||
name: Test (macOS, Apple sillicon) | ||
runs-on: [self-hosted, macOS] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- name: Run tests | ||
run: cargo test -F metal | ||
test_nvidia: | ||
name: Test (Ubuntu, NVIDIA GPU) | ||
runs-on: [self-hosted, cuda] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Rustup toolchain install | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
- name: Run tests | ||
run: cargo test -F cuda |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.PHONY: test clippy | ||
|
||
test: | ||
cargo test | ||
|
||
clippy: | ||
cargo clippy --workspace --all-targets -- -D warnings |