92 lines
2.3 KiB
YAML
92 lines
2.3 KiB
YAML
---
|
|
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "*.md"
|
|
- "LICENSE"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "*.md"
|
|
- "LICENSE"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
fast-checks:
|
|
name: 🏁 Fast Checks (Format)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: setup rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: rustfmt
|
|
- name: install taplo
|
|
run: cargo install taplo-cli --locked
|
|
- name: Run format checks
|
|
run: |
|
|
taplo format --check --config taplo.toml
|
|
cargo fmt --all -- --check
|
|
timeout-minutes: 5
|
|
|
|
build-and-test:
|
|
name: 🛠️ Build & Test
|
|
needs: fast-checks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: setup rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: compile (gpu)
|
|
run: |
|
|
cargo build --locked --workspace
|
|
timeout-minutes: 90
|
|
- name: test (gpu)
|
|
run: |
|
|
cargo test --locked --workspace
|
|
timeout-minutes: 15
|
|
|
|
analysis:
|
|
name: 🤖 Analysis (Clippy & Doc)
|
|
needs: fast-checks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: setup rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: clippy
|
|
- name: clippy (all features)
|
|
run: cargo clippy --locked --workspace --all-features
|
|
timeout-minutes: 30
|
|
- name: doc
|
|
run: cargo doc --locked --workspace --no-deps --all-features
|
|
timeout-minutes: 15
|
|
|
|
benchmark:
|
|
name: 🏃 Benchmark
|
|
needs: fast-checks
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: setup rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: build benchmark binary
|
|
run: cargo build -p miner-cli --release
|
|
timeout-minutes: 60
|
|
- name: run cpu benchmark
|
|
run: ./target/release/quantus-miner benchmark --cpu-workers 2 --duration 5
|
|
timeout-minutes: 10
|