Skip to content

Commit

Permalink
chore: add continuous integration action
Browse files Browse the repository at this point in the history
  • Loading branch information
oknozor committed Jul 3, 2023
1 parent 177d189 commit ee4f882
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config --global user.email github-actions@github.com
git config --global user.name github-actions
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v3.5
with:
git-user: 'github-actions'
git-user-email: 'github-actions@github.com'

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: llvm-tools-preview

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --all-features --workspace --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true

- uses: Swatinem/rust-cache@v1

lints:
name: Lints & Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: clippy
args: -- -D warnings

- uses: Swatinem/rust-cache@v1

0 comments on commit ee4f882

Please sign in to comment.