zebra/.github/workflows/ci.yml

137 lines
3.8 KiB
YAML
Raw Normal View History

name: CI
on: pull_request
jobs:
test:
name: Test on ${{ matrix.os }}
# The large timeout is to accommodate Windows builds
timeout-minutes: 45
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: Install LLVM on Windows
if: matrix.os == 'windows-latest'
run: choco install llvm -y
2020-10-20 15:55:47 -07:00
- name: Skip network tests on Ubuntu and Windows
# Ubuntu runners don't have network or DNS configured during test steps
2020-10-20 15:55:47 -07:00
# Windows runners have an unreliable network
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
- name: Run tests
2020-08-24 10:04:39 -07:00
env:
RUST_BACKTRACE: full
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
# Explicitly run any tests that are usually #[ignored], modulo ZEBRA_SKIP_NETWORK_TESTS
- name: Run zebrad large sync tests
env:
RUST_BACKTRACE: full
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --manifest-path zebrad/Cargo.toml sync_large_checkpoints_mainnet sync_large_checkpoints_testnet -- --ignored
- name: Run zebrad tracing test
env:
RUST_BACKTRACE: full
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --manifest-path zebrad/Cargo.toml tracing_endpoint -- --ignored
build-chain-no-features:
name: Build zebra-chain w/o features on ubuntu-latest
2020-10-12 15:19:55 -07:00
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: Run build without features enabled
working-directory: ./zebra-chain
env:
RUST_BACKTRACE: full
run: cargo build --verbose --no-default-features
build:
name: Build on ${{ matrix.os }}
2020-10-12 15:19:55 -07:00
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install LLVM on Windows
if: matrix.os == 'windows-latest'
run: choco install llvm -y
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --release
2020-01-23 13:40:32 -08:00
clippy:
name: Clippy (stable)
2020-10-12 15:19:55 -07:00
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
2020-01-24 12:09:01 -08:00
with:
toolchain: stable
components: clippy
override: true
2020-02-04 21:34:38 -08:00
- name: Run clippy
uses: actions-rs/clippy-check@v1
2020-02-04 21:34:38 -08:00
with:
name: Clippy (stable)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
fmt:
name: Rustfmt
2020-10-12 15:19:55 -07:00
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check