Setup github CI workflow #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches-ignore: [stable-docs, gh-pages] | |
pull_request: | |
branches-ignore: [stable-docs, gh-pages] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: Build & Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Run build | |
run: just build | |
- name: Run clippy | |
run: just clippy | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Check format | |
run: just format --check | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Run tests | |
run: just test | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install tarpaulin | |
uses: taiki-e/install-action@cargo-tarpaulin | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Run coverage | |
run: just coverage xml | |
- name: Upload coverage | |
if: ${{ github.event_name == 'push' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./cobertura.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true |