Merge pull request #425 from RustyNova016/feat/no_cleanup #1062
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ "master", "develop" ] | |
pull_request: | |
branches: [ "master", "develop" ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: 1 | |
# Copied from the dotenvy crate | |
# https://github.com/allan2/dotenvy/blob/master/.github/workflows/ci.yml | |
jobs: | |
stable_tests: | |
env: | |
SQLX_OFFLINE: true | |
runs-on: ${{ matrix.os }} | |
needs: clippy | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install stable --profile minimal --no-self-update | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: "(${{ matrix.os }})" | |
- uses: taiki-e/install-action@cargo-hack | |
- name: Build tests | |
run: cargo hack build --feature-powerset --ignore-private | |
- name: Run tests | |
run: cargo hack test --feature-powerset --ignore-private | |
# unstable_tests: | |
# env: | |
# SQLX_OFFLINE: true | |
# runs-on: ${{ matrix.os }} | |
# needs: stable_tests | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# rust: [beta, nightly] | |
# os: | |
# - windows-latest | |
# - ubuntu-latest | |
# - macos-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - run: rustup toolchain install stable --profile minimal --no-self-update | |
# - uses: Swatinem/rust-cache@v2 | |
# with: | |
# key: "(${{ matrix.rust }} - ${{ matrix.os }})" | |
# - uses: taiki-e/install-action@cargo-hack | |
# - name: Build tests | |
# run: cargo hack build --feature-powerset --ignore-private | |
# - name: Run tests | |
# run: cargo hack test --feature-powerset --ignore-private | |
clippy: | |
env: | |
SQLX_OFFLINE: true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Install minimal toolchain | |
- name: Install minimal stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo clippy -- -D warnings | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
env: | |
SQLX_OFFLINE: true | |
RUSTDOCFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- uses: dtolnay/install@cargo-docs-rs | |
- run: cargo doc --no-deps --document-private-items | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Install minimal toolchain | |
- name: Install minimal stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Run rustfmt | |
run: cargo fmt --all --check | |
# This is just a curtesy check to tell whether it should be breaking changes or not | |
# If CI fail because of this, just bump the version | |
msrv: | |
env: | |
SQLX_OFFLINE: true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-msrv | |
run: cargo install cargo-msrv --all-features | |
- name: Run cargo-msrv | |
run: cargo msrv verify --output-format json | |
- name: Run cargo-msrv on verification failure | |
if: ${{ failure() }} | |
run: cargo msrv find --output-format json |