cuprate/.github/workflows/ci.yml

90 lines
1.9 KiB
YAML
Raw Normal View History

2023-10-26 00:39:57 +00:00
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:
2024-01-22 22:41:20 +00:00
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fmt
run: cargo fmt --all --check
2024-01-22 22:30:19 +00:00
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2024-01-22 22:56:07 +00:00
- uses: actions/cache@v3
id: cache
2024-01-22 22:30:19 +00:00
with:
path: target
2024-01-22 22:56:07 +00:00
key: ${{ runner.os }}-cache
2023-10-26 00:39:57 +00:00
2024-01-22 22:30:19 +00:00
- name: Install dependencies
run: sudo apt install -y libboost-dev
- name: Build
2024-01-22 22:56:07 +00:00
run: cargo build --all-features --all-targets --workspace
2024-01-22 22:30:19 +00:00
- uses: actions/cache/save@v3
2024-01-22 22:56:07 +00:00
id: cache-save-short-term
2024-01-22 22:30:19 +00:00
with:
path: target
2024-01-22 22:56:07 +00:00
key: ${{ runner.os }}-cache-${{ github.sha }}
2024-01-22 22:30:19 +00:00
2024-01-22 22:41:20 +00:00
clippy:
2024-01-22 22:30:19 +00:00
runs-on: ubuntu-latest
needs: build
2023-10-26 00:39:57 +00:00
steps:
2024-01-22 22:30:19 +00:00
- uses: actions/checkout@v3
2023-10-26 00:39:57 +00:00
2024-01-22 22:30:19 +00:00
- uses: actions/cache/restore@v3
id: cache
with:
path: target
2024-01-22 22:56:07 +00:00
key: ${{ runner.os }}-cache-${{ github.sha }}
- name: Install dependencies
run: sudo apt install -y libboost-dev
2023-10-26 00:39:57 +00:00
2024-01-22 22:30:19 +00:00
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
2024-01-22 22:30:19 +00:00
tests:
runs-on: ubuntu-latest
needs: build
2023-12-03 00:29:12 +00:00
2024-01-22 22:30:19 +00:00
steps:
- uses: actions/checkout@v3
2023-10-26 00:39:57 +00:00
2024-01-22 22:30:19 +00:00
- uses: actions/cache/restore@v3
id: cache
with:
path: target
2024-01-22 22:56:07 +00:00
key: ${{ runner.os }}-cache-${{ github.sha }}
- name: Spawn monerod
uses: ./.github/actions/monerod-regtest
- name: Install dependencies
run: sudo apt install -y libboost-dev
2023-10-26 00:39:57 +00:00
2024-01-22 22:30:19 +00:00
- name: Test
run: cargo test --all-features --workspace --all-targets && cargo test --all-features --workspace --doc