Skip to content

Commit

Permalink
Merge pull request #109 from rust-pretty-assertions/update-ci
Browse files Browse the repository at this point in the history
chore: update ci
  • Loading branch information
tommilligan committed Mar 31, 2023
2 parents 27ee628 + 913a879 commit 3fe5da4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/check.yml
Expand Up @@ -2,38 +2,40 @@ on: [push, pull_request]

name: check

env:
CARGO_TERM_COLOR: always

jobs:
# Test, and also do other things like doctests and examples
detailed-test:
name: Test main target
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cache build files
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
~/.cargo/bin
cargo_target
key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-v2
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-v3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy, rustfmt
- name: Install toolchain (nightly)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: false
- name: Install additional test dependencies
env:
CARGO_TARGET_DIR: cargo_target
run: ./scripts/install
profile: minimal
- name: Run check script
run: ./scripts/check

Expand All @@ -44,7 +46,7 @@ jobs:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
rust:
- stable
Expand All @@ -54,31 +56,34 @@ jobs:
- false
# Run a canary test on nightly that's allowed to fail
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
rust: nightly
experimental: true
# Don't bother retesting stable linux, we did it in the comprehensive test
exclude:
- os: ubuntu-20.04
- os: ubuntu-22.04
rust: stable
experimental: false
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cache build files
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: test-${{ matrix.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.toml') }}
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-${{ matrix.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.toml') }}-v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- name: Run tests
run: cargo test --package pretty_assertions
4 changes: 0 additions & 4 deletions scripts/check
Expand Up @@ -9,10 +9,6 @@ function eprintln() {
eprintln "Formatting sources"
cargo fmt -- --check

eprintln "Auditing dependencies"
cargo audit --deny warnings \
--ignore RUSTSEC-2021-0127 # unmaintained serde_cbor

eprintln "Linting sources"
cargo clippy --all-targets -- -D warnings

Expand Down
1 change: 0 additions & 1 deletion scripts/install
Expand Up @@ -3,4 +3,3 @@
set -exuo pipefail

rustup component add rustfmt clippy
cargo install cargo-audit

0 comments on commit 3fe5da4

Please sign in to comment.