Skip to content

Commit

Permalink
Merge pull request #8 from lambdaclass/add_ci
Browse files Browse the repository at this point in the history
Add CI file
  • Loading branch information
MauroToscano committed May 26, 2023
2 parents 7c1606a + 12f920c commit 7feef38
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/ci.yaml
@@ -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
7 changes: 7 additions & 0 deletions Makefile
@@ -0,0 +1,7 @@
.PHONY: test clippy

test:
cargo test

clippy:
cargo clippy --workspace --all-targets -- -D warnings

0 comments on commit 7feef38

Please sign in to comment.