Skip to content

Commit

Permalink
feat(ci): add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Mar 13, 2024
1 parent 60ef76a commit 915625b
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Check lints
run: cargo clippy -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check

check-docs:
name: Check docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-rdme
uses: taiki-e/install-action@v2
with:
tool: cargo-rdme
- name: Check README.md is up-to-date
run: cargo rdme --check

coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --lcov --output-path target/lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

audit:
name: Perform audit for security
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Run cargo-audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 915625b

Please sign in to comment.