2019-09-05 10:08:48 -07:00
|
|
|
name: CI
|
2020-10-12 14:19:00 -07:00
|
|
|
|
2021-02-15 17:50:32 -08:00
|
|
|
on:
|
2021-02-16 14:04:00 -08:00
|
|
|
workflow_dispatch:
|
2021-02-15 17:50:32 -08:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
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:
|
2021-02-11 08:33:30 -08:00
|
|
|
name: Test (+${{ matrix.rust }}) on ${{ matrix.os }}
|
2020-11-20 12:03:27 -08:00
|
|
|
# The large timeout is to accommodate Windows builds
|
2021-02-16 07:53:04 -08:00
|
|
|
timeout-minutes: 60
|
2020-05-14 13:31:01 -07:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2021-02-18 15:54:35 -08:00
|
|
|
fail-fast: false
|
2020-05-14 13:31:01 -07:00
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
2021-07-28 20:02:12 -07:00
|
|
|
rust: [stable]
|
2021-02-15 15:44:49 -08:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
2021-02-16 14:04:00 -08:00
|
|
|
RUST_BACKTRACE: full
|
2020-05-14 13:31:01 -07:00
|
|
|
|
2019-09-05 10:08:48 -07:00
|
|
|
steps:
|
2021-05-12 14:51:12 -07:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-05-14 13:31:01 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-02-11 07:06:54 -08:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2021-04-29 13:47:15 -07:00
|
|
|
profile: minimal
|
2020-05-14 13:31:01 -07:00
|
|
|
override: true
|
2021-06-14 18:36:33 -07:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2020-05-14 13:31:01 -07:00
|
|
|
- name: cargo fetch
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-05-14 13:31:01 -07:00
|
|
|
with:
|
|
|
|
command: fetch
|
2021-06-14 18:36:33 -07:00
|
|
|
|
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'
|
2021-04-19 03:39:24 -07:00
|
|
|
run: |
|
|
|
|
choco install llvm -y
|
|
|
|
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-02-19 01:36:32 -08:00
|
|
|
- name: Skip network tests on Ubuntu
|
2021-02-16 01:37:26 -08:00
|
|
|
# Ubuntu runners don't have network or DNS configured during test steps
|
2021-02-19 01:36:32 -08:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2020-10-18 21:03:24 -07:00
|
|
|
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-02-19 01:36:32 -08:00
|
|
|
- name: Skip network tests on Windows
|
|
|
|
# Windows runners have an unreliable network
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
- name: Show env vars
|
|
|
|
run: |
|
|
|
|
echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}"
|
|
|
|
echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}"
|
|
|
|
echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}"
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-05-14 13:31:01 -07:00
|
|
|
- name: Run tests
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-05-14 13:31:01 -07:00
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --verbose --all
|
2021-08-23 07:17:33 -07:00
|
|
|
|
|
|
|
- name: Run tests with fake activation heights
|
|
|
|
uses: actions-rs/cargo@v1.0.3
|
|
|
|
env:
|
|
|
|
TEST_FAKE_ACTIVATION_HEIGHTS:
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --verbose --all -- with_fake_activation_heights
|
|
|
|
|
2021-02-19 01:36:32 -08:00
|
|
|
# Explicitly run any tests that are usually #[ignored]
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-10-27 02:25:29 -07:00
|
|
|
- name: Run zebrad large sync tests
|
2021-02-19 01:36:32 -08:00
|
|
|
# Skip the entire step on Ubuntu and Windows, because the test would be skipped anyway due to ZEBRA_SKIP_NETWORK_TESTS
|
|
|
|
if: matrix.os == 'macOS-latest'
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-10-27 02:25:29 -07:00
|
|
|
with:
|
|
|
|
command: test
|
2020-10-30 13:06:48 -07:00
|
|
|
args: --verbose --manifest-path zebrad/Cargo.toml sync_large_checkpoints_ -- --ignored
|
2020-08-14 16:51:03 -07:00
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
build-chain-no-features:
|
2021-02-11 08:44:06 -08:00
|
|
|
name: Build (+${{ matrix.rust }}) zebra-chain w/o features on ubuntu-latest
|
2021-02-16 07:53:04 -08:00
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
2021-02-11 08:41:05 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust: [stable, beta]
|
2021-02-16 14:04:00 -08:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
|
2021-02-16 07:53:04 -08:00
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
steps:
|
2021-05-12 14:51:12 -07:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-02-11 08:41:05 -08:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2021-04-29 13:47:15 -07:00
|
|
|
profile: minimal
|
2020-09-23 18:52:52 -07:00
|
|
|
override: true
|
2021-06-14 18:36:33 -07:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
- name: cargo fetch
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-09-23 18:52:52 -07:00
|
|
|
with:
|
|
|
|
command: fetch
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
- name: Show env vars
|
|
|
|
run: |
|
|
|
|
echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}"
|
|
|
|
echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}"
|
|
|
|
echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}"
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
- name: Run build without features enabled
|
|
|
|
working-directory: ./zebra-chain
|
|
|
|
run: cargo build --verbose --no-default-features
|
|
|
|
|
2020-08-14 16:51:03 -07:00
|
|
|
build:
|
2021-04-29 13:54:47 -07:00
|
|
|
name: Build (+stable) on ubuntu-latest
|
2021-02-16 07:53:04 -08:00
|
|
|
timeout-minutes: 60
|
2021-04-29 13:54:47 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUST_BACKTRACE: full
|
2020-08-14 16:51:03 -07:00
|
|
|
|
|
|
|
steps:
|
2021-05-12 14:51:12 -07:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-08-14 16:51:03 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-04-29 13:54:47 -07:00
|
|
|
toolchain: stable
|
2021-04-29 13:47:15 -07:00
|
|
|
profile: minimal
|
2020-08-14 16:51:03 -07:00
|
|
|
override: true
|
2021-06-14 18:36:33 -07:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2020-08-14 16:51:03 -07:00
|
|
|
- name: cargo fetch
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-08-14 16:51:03 -07:00
|
|
|
with:
|
|
|
|
command: fetch
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
- name: Show env vars
|
|
|
|
run: |
|
|
|
|
echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}"
|
|
|
|
echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}"
|
|
|
|
echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}"
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-05-14 13:31:01 -07:00
|
|
|
- name: Build
|
2021-05-12 14:54:02 -07:00
|
|
|
uses: actions-rs/cargo@v1.0.3
|
2020-05-14 13:31:01 -07:00
|
|
|
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
|
2021-02-16 14:04:00 -08:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
|
2020-04-21 01:51:05 -07:00
|
|
|
steps:
|
2021-05-12 14:51:12 -07:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-04-21 01:51:05 -07:00
|
|
|
- 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
|
2021-06-14 18:36:33 -07:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
- name: Show env vars
|
|
|
|
run: |
|
|
|
|
echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}"
|
|
|
|
echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}"
|
|
|
|
echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}"
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-02-04 21:34:38 -08:00
|
|
|
- name: Run clippy
|
2021-05-12 14:52:10 -07:00
|
|
|
uses: actions-rs/clippy-check@v1.0.7
|
2020-02-04 21:34:38 -08:00
|
|
|
with:
|
2021-06-14 15:24:53 -07:00
|
|
|
# GitHub displays the clippy job and its results as separate entries
|
2021-06-14 16:40:33 -07:00
|
|
|
name: Clippy (stable) Results
|
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
|
2021-02-16 14:04:00 -08:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
RUST_BACKTRACE: full
|
|
|
|
|
2020-05-27 19:12:25 -07:00
|
|
|
steps:
|
2021-05-12 14:51:12 -07:00
|
|
|
- uses: actions/checkout@v2.3.4
|
2021-05-16 16:32:38 -07:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2020-05-27 19:12:25 -07:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2021-04-29 13:47:15 -07:00
|
|
|
components: rustfmt
|
2020-05-27 19:12:25 -07:00
|
|
|
override: true
|
2021-06-14 18:36:33 -07:00
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
|
2021-02-16 14:04:00 -08:00
|
|
|
- name: Show env vars
|
|
|
|
run: |
|
|
|
|
echo "ZEBRA_SKIP_NETWORK_TESTS=${{ env.ZEBRA_SKIP_NETWORK_TESTS }}"
|
|
|
|
echo "CARGO_INCREMENTAL=${{ env.CARGO_INCREMENTAL }}"
|
|
|
|
echo "RUST_BACKTRACE=${{ env.RUST_BACKTRACE }}"
|
2021-06-14 18:36:33 -07:00
|
|
|
|
2021-05-12 14:54:02 -07:00
|
|
|
- uses: actions-rs/cargo@v1.0.3
|
2020-05-27 19:12:25 -07:00
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|