[ BREAKING CHANGE] Feat/context template #16
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Tests for platform ${{ matrix.os }}/${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target: x86_64-osx | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
coverage: true | |
conventional_commit_check: true | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-musleabihf | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
key: "${{ matrix.os }}-${{ matrix.target }}" | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- uses: taiki-e/install-action@nextest | |
- name: Collect coverage data | |
if: ${{matrix.coverage}} | |
run: cargo llvm-cov nextest --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
if: ${{matrix.coverage}} | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
fail_ci_if_error: true | |
- name: Test with latest nextest release | |
if: ${{ ! matrix.coverage }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: nextest | |
args: run --test-threads=1 | |
lints: | |
name: Lints & Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- 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 | |
e2e: | |
name: End to end tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Run bats test harnesss | |
run: | | |
docker build -t bombadil-tests ./ | |
docker run bombadil-tests |