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