Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): update ci workflow #8

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/