split rustfmt and clippy checks into separate jobs #1539
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
rust: ["stable", "beta", "nightly"] | |
os: [ubuntu-latest, macos-latest] | |
name: Cargo test | |
runs-on: ${{ matrix.os }} | |
if: github.repository == 'graphql-rust/graphql-client' | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Execute cargo test | |
run: cargo test --all --tests --examples | |
wasm_build: | |
name: Cargo build for wasm | |
runs-on: ubuntu-latest | |
if: github.repository == 'graphql-rust/graphql-client' | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: wasm32-unknown-unknown | |
- name: Execute cargo build | |
run: | | |
cargo build --manifest-path=./graphql_client/Cargo.toml --features="reqwest" --target wasm32-unknown-unknown | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo fmt --all -- --check | |
lint: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2024-01-10 | |
components: clippy | |
- run: cargo clippy --all --all-targets --all-features -- -D warnings | |
prettier: | |
name: Check prettier | |
runs-on: ubuntu-latest | |
if: github.repository == 'graphql-rust/graphql-client' | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install node.js | |
run: sudo apt update && sudo apt-get install -y nodejs | |
- name: Execute prettier | |
run: npx prettier --debug-check -l './**/*.json' './**/*.graphql' |