Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding github actions for linting and testing #26

Closed
wants to merge 17 commits into from
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: false
shared-key: base

- name: Install Cargo tools
run: |
rustup component add rustfmt clippy

- name: Check that cargo lockfile is up to date
run: |
cargo check --locked --all-targets
patnir marked this conversation as resolved.
Show resolved Hide resolved

- name: Check for license headers
run: ./ci/lintHeaders.sh ./src *.rs

- name: "`cargo fmt` check"
run: |
cargo fmt --all -- --check

- name: "Clippy check on"
run: |
cargo clippy --all-targets -- -D warnings

test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: false
shared-key: base

- name: Install Cargo tools
run: |
rustup component add rustfmt clippy
patnir marked this conversation as resolved.
Show resolved Hide resolved

- name: Run tests
run: |
cargo test
patnir marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/Cargo.lock
/target
Loading
Loading