Skip to content

CI

CI #1838

Workflow file for this run

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
lint:
name: Rustfmt and Clippy
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:
components: clippy,rustfmt
- name: Execute cargo fmt
run: cargo fmt --all -- --check
- name: Execute cargo 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'