Skip to content

Commit

Permalink
meta: Add Github CI workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
luleyleo committed Sep 6, 2024
1 parent 7d511c1 commit 5f8ca24
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

env:
RUST_VERSION: 1.80.0
CARGO_TERM_COLOR: always

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
components: clippy

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets --all-features -- -D warnings

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
# --all-targets includes --benches, which we don't want.
args: --workspace --all-features --lib --bins --tests --examples --verbose

rustfmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install nightly toolchain with rustfmt available
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --verbose

doc:
name: Doc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -D warnings
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true

- name: Run cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --verbose

- name: Run cargo test --doc
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features --doc --verbose

0 comments on commit 5f8ca24

Please sign in to comment.