Skip to content

Commit

Permalink
chore(ci): update ci workflow (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
LNSD authored Sep 19, 2023
1 parent 5daca78 commit ad651d0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 40 deletions.
94 changes: 56 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,89 @@
name: Continuous Integration

name: ci
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

jobs:
unit-tests:
name: unit tests
rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 10
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- name: unit tests
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: test
args: --verbose --workspace -- --nocapture
toolchain: stable
components: rustfmt

rustfmt:
name: rustfmt
- name: Cache rust cargo build files
uses: Leafwing-Studios/cargo-cache@v1

- run: cargo fmt --all -- --check

clippy:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2

- name: rustfmt
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
toolchain: stable
components: clippy

clippy:
name: clippy
- name: Cache rust cargo build files
uses: Leafwing-Studios/cargo-cache@v1

- run: cargo clippy --all --all-targets --all-features

release-check:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- name: clippy
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: clippy
toolchain: stable

release-check:
name: release check
- name: Cache rust cargo build files
uses: Leafwing-Studios/cargo-cache@v1

- name: check (release)
run: cargo check --release --all --all-targets --all-features

tests:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- name: release check
uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
command: check
args: --release
toolchain: stable

- name: Cache rust cargo build files
uses: Leafwing-Studios/cargo-cache@v1

- name: Unit tests
run: cargo test --verbose --workspace --lib -- --nocapture

- name: Integration tests
run: cargo test --verbose --workspace --tests '*' -- --nocapture
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
/target
/Cargo.lock
## IDEs and Editors
.idea/
.vscode/

## Rust
debug/
target/
**/*.rs.bk
Cargo.lock
*.pdb

## Project
test-outputs/

0 comments on commit ad651d0

Please sign in to comment.