decouple serde_derive and serde #224
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: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
push: | |
branches: [main] | |
merge_group: | |
types: [checks_requested] | |
env: | |
MSRV: 1.63.0 | |
jobs: | |
ci: | |
name: CI | |
needs: [test, fmt, clippy, docs, release] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | |
- name: Done | |
run: exit 0 | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [test, fmt, clippy, docs] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # fetch tags for publish | |
# ssh-key: "${{ secrets.COMMIT_KEY }}" # use deploy key to trigger workflow on tag | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo xtask release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
test: | |
name: Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
rust: ["", nightly] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust || env.MSRV }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test twitch_types | |
run: cargo test --all-targets --all-features ${{matrix.rust == 'nightly' && '--workspace'}} | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- name: Run fmt --all -- --check | |
run: cargo fmt --all -- --check | |
prettier: | |
name: Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check formatting with Prettier | |
# Explicit commit, because this isn't tagged yet. | |
uses: actionsx/prettier@3d9f7c3fa44c9cb819e68292a328d7f4384be206 | |
with: | |
args: -c . | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo clippy --locked | |
- name: Run clippy --all-targets --all-features --workspace | |
run: cargo clippy --locked --all-targets --all-features --workspace | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
# We do the following to make sure docs.rs can document properly without anything broken, and that docs are working. | |
- name: Run doc tests | |
run: cargo test --doc --all-features --locked | |
- name: Check twitch_types docs | |
env: | |
RUSTDOCFLAGS: "--cfg nightly" | |
RUSTFLAGS: "--cfg nightly" | |
run: cargo doc --locked --no-deps --all-features |