name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --check
- name: Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Test
env:
UPKEEP_REQUIRE_NETWORK_TESTS: "1"
run: cargo test --locked --all-features
- name: Test installer
run: bash ./tests/install.sh
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read MSRV from Cargo.toml
id: msrv
run: echo "version=$(grep '^rust-version = ' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')" >> "$GITHUB_OUTPUT"
- name: Install Rust ${{ steps.msrv.outputs.version }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.version }}
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Check against declared MSRV
run: cargo check --locked --all-targets