Skip to content

Commit

Permalink
Add GitHub Actions workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Mayer <[email protected]>
  • Loading branch information
sunsided committed Jun 23, 2024
1 parent 9ec6c0f commit 7b23967
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
ignore-words-list = crate
skip = .git,*.lock
19 changes: 19 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
93 changes: 93 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
name: Rust

on:
push:
branches: [ "main" ]
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
- '.github/workflows/rust.yml'
pull_request:
branches: [ "main" ]
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
- '.github/workflows/rust.yml'

env:
CARGO_TERM_COLOR: always

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check format
run: cargo fmt --check
- name: Clippy
run: cargo clippy

docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build documentation
run: cargo doc

codecov:
needs: lint
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Build Benchmarks
run: cargo build --benches --package minikalman
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Generate code coverage
run: cargo llvm-cov nextest --features=std,unsafe --workspace ---lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true

build-std:
needs:
- lint
- docs
name: Build and Test (floating-point)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run doctests
run: cargo test --doc --verbose --package marg-orientation --no-default-features --features=std

build-others:
needs:
- codecov
- build-std
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --package marg-orientation --verbose
- name: Run doctests
run: cargo test --doc --package marg-orientation --verbose

0 comments on commit 7b23967

Please sign in to comment.