name: CI
on:
push:
branches: [main, "**-dev"]
paths: ["**/*.rs", "**/*.yml", "**/*.toml", "**/*.lock"]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
uses: tobealive/wthrr-the-weathercrab/.github/workflows/lint.yml@main
test:
needs: lint
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-11, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Run test
env:
RUST_BACKTRACE: full
run: |
cargo nextest run --verbose --profile ci
- if: runner.os == 'Linux'
name: Publish test results for Linux
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: target/nextest/ci/junit.xml
check_name: test results (${{ matrix.os }})
comment_title: Test Results
- if: runner.os != 'Linux'
name: Publish test results for ${{ runner.os }}
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
junit_files: target/nextest/ci/junit.xml
check_name: test results (${{ matrix.os }})
comment_title: Test Results
comment_mode: off
build:
needs: test
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-11, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose