133 lines
3.7 KiB
YAML
133 lines
3.7 KiB
YAML
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
|
|
- name: Skip network tests on Ubuntu and Windows
|
|
# Ubuntu runners don't have network or DNS configured during test steps
|
|
# 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
|
|
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
|
|
# There is a compiler issue when building the acceptance integration
|
|
# test binary, this disables these tests on Windows for now.
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --verbose --manifest-path zebrad/Cargo.toml sync_large_checkpoints_ -- --ignored
|
|
|
|
build-chain-no-features:
|
|
name: Build zebra-chain w/o features on ubuntu-latest
|
|
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 }}
|
|
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
|
|
|
|
clippy:
|
|
name: Clippy (stable)
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
override: true
|
|
- name: Run clippy
|
|
uses: actions-rs/clippy-check@v1
|
|
with:
|
|
name: Clippy (stable)
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --all-features --all-targets -- -D warnings
|
|
|
|
fmt:
|
|
name: Rustfmt
|
|
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
|