2020-01-09 16:23:03 -08:00
|
|
|
name: CI
|
2020-01-09 16:02:40 -08:00
|
|
|
|
2020-01-09 16:23:03 -08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request: {}
|
2020-01-09 16:02:40 -08:00
|
|
|
|
|
|
|
jobs:
|
2020-01-09 16:23:03 -08:00
|
|
|
test-workspace:
|
2020-01-09 16:02:40 -08:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, windows-2019, macOS-10.14]
|
|
|
|
rust: [stable, nightly]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Install rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
args: --verbose
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
env:
|
|
|
|
CI: 'True'
|
|
|
|
RUSTFLAGS: '-D warnings'
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --verbose
|
|
|
|
|
2020-01-09 16:23:03 -08:00
|
|
|
test:
|
2020-01-09 16:02:40 -08:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
crate:
|
|
|
|
- tower
|
|
|
|
- tower-balance
|
|
|
|
- tower-buffer
|
|
|
|
- tower-discover
|
|
|
|
- tower-filter
|
|
|
|
- tower-hedge
|
|
|
|
- tower-layer
|
|
|
|
- tower-limit
|
|
|
|
- tower-load
|
|
|
|
- tower-load-shed
|
|
|
|
- tower-make
|
|
|
|
- tower-ready-cache
|
|
|
|
- tower-reconnect
|
|
|
|
- tower-retry
|
|
|
|
- tower-service
|
|
|
|
- tower-spawn-ready
|
|
|
|
- tower-test
|
|
|
|
- tower-timeout
|
|
|
|
- tower-util
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Install rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- name: Patch
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
# Remove any existing patch statements
|
|
|
|
mv Cargo.toml Cargo.toml.bck
|
|
|
|
sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml
|
|
|
|
# Patch all crates
|
2020-01-09 16:23:03 -08:00
|
|
|
cat .github/workflows/patch.toml >> Cargo.toml
|
2020-01-09 16:02:40 -08:00
|
|
|
# Print `Cargo.toml` for debugging
|
|
|
|
echo "~~~~ Cargo.toml ~~~~"
|
|
|
|
cat Cargo.toml
|
|
|
|
echo "~~~~~~~~~~~~~~~~~~~~"
|
|
|
|
- name: Build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
args: -p ${{ matrix.crate }} --verbose
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
env:
|
|
|
|
CI: 'True'
|
|
|
|
RUSTFLAGS: '-D warnings'
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: -p ${{ matrix.crate }} --verbose
|
|
|
|
|
2020-01-09 16:23:03 -08:00
|
|
|
rustfmt:
|
2020-01-09 16:02:40 -08:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Ensure that rustfmt is installed
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt
|
|
|
|
- name: Run rustfmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
|
|
|
|
|
|
|
# This is failing, because it finds errors...
|
|
|
|
# clippy_check:
|
|
|
|
#
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
#
|
|
|
|
# steps:
|
|
|
|
# - name: Checkout code
|
|
|
|
# uses: actions/checkout@v1
|
|
|
|
# - name: Ensure that clippy is installed
|
|
|
|
# uses: actions-rs/toolchain@v1
|
|
|
|
# with:
|
|
|
|
# toolchain: nightly
|
|
|
|
# override: true
|
|
|
|
# components: clippy
|
|
|
|
# - name: Run clippy
|
|
|
|
# uses: actions-rs/clippy-check@v1
|
|
|
|
# with:
|
|
|
|
# token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# args: --all-targets --all-features
|