forked from mirrors/jj
95121a09c0
For example, this should check for broken links from one `.md` file to another.
110 lines
3.1 KiB
YAML
110 lines
3.1 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
permissions: read-all
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-13, windows-latest]
|
|
cargo_flags: [""]
|
|
include:
|
|
- os: ubuntu-latest
|
|
cargo_flags: "--all-features"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: 1.71
|
|
- name: Build
|
|
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
- name: Test
|
|
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
|
|
check-protos:
|
|
name: Check protos
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: stable
|
|
- run: sudo apt update && sudo apt-get -y install protobuf-compiler
|
|
- name: Generate Rust code from .proto files
|
|
run: cargo run -p gen-protos
|
|
- name: Check for uncommitted changes
|
|
run: git diff --exit-code
|
|
|
|
rustfmt:
|
|
name: Check formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt
|
|
- run: cargo +nightly fmt --all -- --check
|
|
|
|
mkdocs:
|
|
name: Check that MkDocs can build the docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install poetry
|
|
uses: abatilo/actions-poetry@v2
|
|
with:
|
|
poetry-version: latest
|
|
- name: Install dependencies
|
|
run: poetry install
|
|
- name: Check that `mkdocs` can build the docs
|
|
run: poetry run -- mkdocs build --strict
|
|
|
|
cargo-deny:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
checks:
|
|
- advisories
|
|
- bans licenses sources
|
|
|
|
# Prevent sudden announcement of a new advisory from failing ci:
|
|
continue-on-error: ${{ matrix.checks == 'advisories' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
|
- uses: EmbarkStudios/cargo-deny-action@a50c7d5f86370e02fae8472c398f15a36e517bb8
|
|
with:
|
|
command: check ${{ matrix.checks }}
|
|
|
|
clippy-check:
|
|
name: Clippy check
|
|
permissions:
|
|
checks: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|