cuprate-hinto-janai/.github/workflows/ci.yml
2024-01-22 23:08:06 +00:00

89 lines
1.9 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@v3
id: cache
with:
path: target
key: ${{ runner.os }}-cache
- name: Install dependencies
run: sudo apt install -y libboost-dev
- name: Build
run: cargo build --all-features --all-targets --workspace
- uses: actions/cache/save@v3
id: cache-save-short-term
with:
path: target
key: ${{ runner.os }}-cache-${{ github.sha }}
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 }}-cache-${{ github.sha }}
- name: Install dependencies
run: sudo apt install -y libboost-dev
- 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 }}-cache-${{ github.sha }}
- name: Spawn monerod
uses: ./.github/actions/monerod-regtest
- name: Install dependencies
run: sudo apt install -y libboost-dev
- name: Test
run: cargo test --all-features --workspace --all-targets && cargo test --all-features --workspace --doc