115 lines
2.8 KiB
YAML
115 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
|
|
test:
|
|
name: Test 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: 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: Run tests
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --verbose --all
|
|
|
|
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
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
components: clippy
|
|
override: true
|
|
- name: Run clippy
|
|
uses: actions-rs/clippy-check@v1
|
|
with:
|
|
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
|