mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-23 03:59:31 +00:00
80 lines
1.7 KiB
YAML
80 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
# Show full panics.
|
|
RUST_BACKTRACE: "full"
|
|
# Increase thread stack size to 8 megabytes.
|
|
RUST_MIN_STACK: 8000000
|
|
|
|
jobs:
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Fmt
|
|
run: cargo fmt --all --check
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache/restore@v3
|
|
id: cache-restore
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt install -y libboost-dev
|
|
|
|
- name: Build
|
|
run: cargo build --all-features
|
|
|
|
- uses: actions/cache/save@v3
|
|
id: cache-save
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache/restore@v3
|
|
id: cache
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache/restore@v3
|
|
id: cache
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Test
|
|
run: cargo test --all-features --workspace --all-targets && cargo test --all-features --workspace --doc
|