mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-28 23:32:41 +00:00
8cb429d065
Summary: Let's be more aggressive about tracking the latest stable Rust release. There's little benefit to being conservative so early on, especially when no users seem to have faced any issue with upgrading, or strictly required an old Rust version. Right now, just lagging Rust by 1 major release probably seems fine. We're targeting 1.71.0 to get ahead of the curve, since 1.72.0 will likely release sometime before the next `jj` release. Signed-off-by: Austin Seipp <aseipp@pobox.com> Change-Id: I4e691b6ba63b5b9023a75ae0a6917672
98 lines
2.8 KiB
YAML
98 lines
2.8 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-latest, windows-latest]
|
|
rust_version: [stable]
|
|
cargo_flags: [""]
|
|
include:
|
|
- os: ubuntu-latest
|
|
rust_version: "1.71"
|
|
cargo_flags: ""
|
|
- os: ubuntu-latest
|
|
rust_version: stable
|
|
cargo_flags: "--all-features"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
|
- name: Install Rust (${{ matrix.rust_version }})
|
|
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: ${{ matrix.rust_version }}
|
|
- 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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
|
- 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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: nightly
|
|
components: rustfmt
|
|
- run: cargo +nightly fmt --all -- --check
|
|
|
|
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
|
- uses: EmbarkStudios/cargo-deny-action@e0a440755b184aa50374330fa75cca0f84fcb59a
|
|
with:
|
|
command: check ${{ matrix.checks }}
|
|
|
|
clippy-check:
|
|
name: Clippy check
|
|
permissions:
|
|
checks: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
|
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
- run: cargo +stable clippy --all-features --workspace --all-targets -- -D warnings
|