Skip to content

Commit

Permalink
ci(rs): split lint and test jobs across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Sep 30, 2024
1 parent fd38885 commit 1953eca
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions template/rs/{{cookiecutter.project_slug}}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,44 @@ on:
workflow_dispatch:

jobs:
ci:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --all-features --workspace
- name: Check formatting
run: cargo fmt --all --check

- name: Check formatting
run: cargo fmt --all --check
- name: Clippy check
run: cargo clippy --all-targets --all-features --workspace -- -D warnings

- name: Clippy check
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --all-features --workspace --examples

- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --all-features --workspace --examples
test:
runs-on: {{ "${{ matrix.os }}" }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --all-features --workspace

0 comments on commit 1953eca

Please sign in to comment.