zebra/.github/workflows/main.yml

87 lines
2.1 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# build:
# name: Google Cloud Build
# 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
test:
name: Build and test on ${{ matrix.os }}
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: 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
grcov:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
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
with:
toolchain: stable
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features