1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Update Cargo.lock
run: |
cargo update
git config --global user.email "test-user@example.com"
git config --global user.name "Test User"
git commit -am "Update Cargo.lock for clippy"
- name: Lint (clippy)
run: cargo hack clippy --all-targets --feature-powerset
- name: Install cargo readme
uses: taiki-e/install-action@v2
with:
tool: cargo-readme
- name: Run cargo readme
run: ./scripts/regenerate-readmes.sh
- name: Check for differences
run: git diff --exit-code
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
# 1.70 is the MSRV
rust-version:
- "1.70"
- stable
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
components: rustfmt, clippy
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
cargo hack build --feature-powerset
- name: Test
# Dev dependencies have an MSRV > 1.70.
if: ${{ matrix.rust-version.version == 'stable' }}
run: cargo hack test --feature-powerset
- name: Test with updated Cargo.lock
# Dev dependencies have an MSRV > 1.70.
if: ${{ matrix.rust-version.version == 'stable' }}
run: |
cargo update
cargo hack test --feature-powerset
|