2019-09-05 10:08:48 -07:00
|
|
|
name: CI
|
2020-10-12 14:19:00 -07:00
|
|
|
|
2020-09-10 11:25:30 -07:00
|
|
|
on: pull_request
|
2020-09-23 18:52:52 -07:00
|
|
|
|
2019-09-05 10:08:48 -07:00
|
|
|
jobs:
|
|
|
|
|
2020-05-14 13:31:01 -07:00
|
|
|
test:
|
2020-08-14 16:51:03 -07:00
|
|
|
name: Test on ${{ matrix.os }}
|
2020-11-20 12:03:27 -08:00
|
|
|
# The large timeout is to accommodate Windows builds
|
|
|
|
timeout-minutes: 45
|
2020-05-14 13:31:01 -07:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
|
|
|
2019-09-05 10:08:48 -07:00
|
|
|
steps:
|
2020-05-14 13:31:01 -07:00
|
|
|
- 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
|
2020-10-18 21:03:24 -07:00
|
|
|
- name: Install LLVM on Windows
|
2020-08-18 11:08:53 -07:00
|
|
|
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
|
2020-10-18 21:03:24 -07:00
|
|
|
# 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'
|
2020-10-18 21:03:24 -07:00
|
|
|
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
|
2020-05-14 13:31:01 -07:00
|
|
|
- name: Run tests
|
2020-08-24 10:04:39 -07:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
2020-05-14 13:31:01 -07:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --verbose --all
|
2020-11-20 12:03:27 -08:00
|
|
|
# Explicitly run any tests that are usually #[ignored], modulo ZEBRA_SKIP_NETWORK_TESTS
|
2020-10-27 02:25:29 -07:00
|
|
|
- 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 -- --ignored
|
2020-08-14 16:51:03 -07:00
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
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
|
2020-09-23 18:52:52 -07:00
|
|
|
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
|
|
|
|
|
2020-08-14 16:51:03 -07:00
|
|
|
build:
|
|
|
|
name: Build on ${{ matrix.os }}
|
2020-10-12 15:19:55 -07:00
|
|
|
timeout-minutes: 30
|
2020-08-14 16:51:03 -07:00
|
|
|
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
|
2020-10-18 21:03:24 -07:00
|
|
|
- name: Install LLVM on Windows
|
2020-08-18 11:08:53 -07:00
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
run: choco install llvm -y
|
2020-08-14 16:51:03 -07:00
|
|
|
- name: cargo fetch
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fetch
|
2020-05-14 13:31:01 -07:00
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --verbose --release
|
2020-01-23 13:40:32 -08:00
|
|
|
|
2020-04-21 01:51:05 -07:00
|
|
|
clippy:
|
2020-10-18 18:06:03 -07:00
|
|
|
name: Clippy (stable)
|
2020-10-12 15:19:55 -07:00
|
|
|
timeout-minutes: 30
|
2020-04-21 01:51:05 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
2020-01-24 12:09:01 -08:00
|
|
|
with:
|
2020-10-18 18:06:03 -07:00
|
|
|
toolchain: stable
|
2020-05-15 20:15:35 -07:00
|
|
|
components: clippy
|
2020-04-21 01:51:05 -07:00
|
|
|
override: true
|
2020-02-04 21:34:38 -08:00
|
|
|
- name: Run clippy
|
2020-06-16 13:44:32 -07:00
|
|
|
uses: actions-rs/clippy-check@v1
|
2020-02-04 21:34:38 -08:00
|
|
|
with:
|
2020-10-18 18:06:03 -07:00
|
|
|
name: Clippy (stable)
|
2020-06-16 13:44:32 -07:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2020-07-07 16:26:22 -07:00
|
|
|
args: --all-features --all-targets -- -D warnings
|
2020-05-27 19:12:25 -07:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
2020-10-12 15:19:55 -07:00
|
|
|
timeout-minutes: 30
|
2020-05-27 19:12:25 -07:00
|
|
|
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
|