2019-09-05 10:08:48 -07:00
|
|
|
name: CI
|
|
|
|
|
2020-05-13 13:10:04 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2019-09-05 10:08:48 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2020-05-15 20:12:54 -07:00
|
|
|
build:
|
|
|
|
name: Google Cloud Build
|
2020-05-15 20:15:35 -07:00
|
|
|
# This is a pull request, and gcloud would fail for external PRs.
|
|
|
|
if: (!github.head_ref) || (!github.base_ref)
|
2020-05-15 20:12:54 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
|
|
|
|
with:
|
|
|
|
version: '275.0.0'
|
|
|
|
service_account_key: ${{ secrets.GCLOUD_AUTH }}
|
|
|
|
- name: Build, Test, Push to GCR
|
|
|
|
run: |
|
|
|
|
BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \
|
|
|
|
BRANCH_NAME=${BRANCH_NAME,,} && \
|
|
|
|
gcloud builds submit . --config cloudbuild.yaml --project zealous-zebra --substitutions BRANCH_NAME=$BRANCH_NAME
|
2020-05-14 13:31:01 -07:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: Build and test on ${{ matrix.os }}
|
|
|
|
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
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --verbose --all
|
|
|
|
- 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
|
|
|
grcov:
|
|
|
|
name: Code Coverage
|
2020-01-23 13:40:32 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-21 01:51:05 -07:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-23 13:40:32 -08:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2020-04-21 01:51:05 -07:00
|
|
|
- name: Run cargo-tarpaulin
|
|
|
|
uses: actions-rs/tarpaulin@v0.1
|
2020-01-24 12:09:01 -08:00
|
|
|
with:
|
2020-04-21 01:51:05 -07:00
|
|
|
version: '0.12.3'
|
|
|
|
timeout: 300
|
|
|
|
- name: Upload coverage report to Codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: Clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
2020-01-24 12:09:01 -08:00
|
|
|
with:
|
2020-05-15 20:15:35 -07:00
|
|
|
toolchain: nightly
|
|
|
|
components: clippy
|
2020-04-21 01:51:05 -07:00
|
|
|
override: true
|
2020-02-04 21:34:38 -08:00
|
|
|
- name: Run clippy
|
2020-05-15 20:15:35 -07:00
|
|
|
uses: actions-rs/clippy@master # Next gen Clippy Action, unstable
|
2020-02-04 21:34:38 -08:00
|
|
|
with:
|
2020-05-15 20:15:35 -07:00
|
|
|
args: --all-features --all-targets
|