2023-12-07 00:12:28 +01:00
|
|
|
name: "ci"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ["main"]
|
|
|
|
pull_request:
|
|
|
|
branches: ["main"]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: "always"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: "ubuntu-latest"
|
2024-01-27 19:49:31 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust-version: ["1.74.0", "stable"]
|
2023-12-07 00:12:28 +01:00
|
|
|
steps:
|
2024-01-27 19:49:31 +01:00
|
|
|
- uses: "actions/checkout@v4.1.1"
|
|
|
|
|
|
|
|
- uses: "dtolnay/rust-toolchain@master"
|
2023-12-07 00:44:30 +01:00
|
|
|
with:
|
2024-01-27 19:49:31 +01:00
|
|
|
toolchain: "${{ matrix.rust-version }}"
|
2023-12-07 00:44:30 +01:00
|
|
|
components: "clippy, rustfmt"
|
|
|
|
|
2024-01-27 19:49:31 +01:00
|
|
|
- run: "rustc --version"
|
2024-02-08 21:33:35 +01:00
|
|
|
- run: "cargo install cargo-run-bin@1.7.2"
|
|
|
|
|
2023-12-07 00:12:28 +01:00
|
|
|
- run: "cargo build --verbose"
|
2024-02-08 21:33:35 +01:00
|
|
|
- run: "cargo bin mdbook build"
|
2023-12-07 00:12:28 +01:00
|
|
|
- run: "cargo test --verbose"
|
|
|
|
- run: "cargo clippy --verbose -- -D warnings"
|
|
|
|
- run: "cargo fmt -- --check"
|
|
|
|
|
2024-01-27 19:49:31 +01:00
|
|
|
lint-general:
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
steps:
|
|
|
|
- uses: "actions/checkout@v4.1.1"
|
|
|
|
|
|
|
|
- name: "Setup Node.js"
|
|
|
|
uses: "actions/setup-node@v4.0.1"
|
|
|
|
with:
|
2024-02-08 21:33:35 +01:00
|
|
|
node-version: "20.x"
|
2024-01-27 19:49:31 +01:00
|
|
|
|
2024-02-08 21:33:35 +01:00
|
|
|
- run: "npm clean-install"
|
2024-01-27 19:49:31 +01:00
|
|
|
|
2024-02-08 21:33:35 +01:00
|
|
|
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
|
|
|
|
- run: "npm run lint:editorconfig"
|
|
|
|
- run: "npm run lint:markdown"
|
|
|
|
- run: "npm run lint:prettier"
|