ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/.github/workflows/build.yml
Martin von Zweigbergk 5e729eced7 github: also run tests on our MSRV (1.58)
This patch sets up an additional CI strategy running tests on 1.58, to
make sure we don't accidentally use newer features. I've only made it
run on one platform (Linux) to avoid wasting resources. There's of
course a small risk that we start depending on platform-specific APIs
from newer versions.
2022-04-19 16:47:42 -07:00

104 lines
2.9 KiB
YAML

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions: read-all
jobs:
build:
strategy:
fail-fast: false
matrix:
build: [linux, linux-msrv, macos, win]
include:
- build: linux
os: ubuntu-latest
rust_version: stable
- build: linux-msrv
os: ubuntu-latest
rust_version: 1.58
- build: macos
os: macos-latest
rust_version: stable
- build: win
os: windows-latest
rust_version: stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Install Rust (${{ matrix.rust_version }})
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: ${{ matrix.rust_version }}
override: true
profile: minimal
- name: Build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: build
args: --workspace --verbose
- name: Test
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: test
args: --workspace --verbose
env:
RUST_BACKTRACE: 1
rustfmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: fmt
args: --all -- --check
clippy-stable:
name: Clippy check (stable)
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --workspace
clippy-nightly:
name: Clippy check (nightly)
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --workspace