retina/.github/workflows/ci.yml
2021-06-03 16:49:53 -07:00

49 lines
1.1 KiB
YAML

name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
rust:
name: Test
strategy:
matrix:
rust:
- stable
- 1.52
include:
- rust: stable
extra_components: rustfmt
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
- name: Test
run: cargo test --all-features
- name: Check formatting
if: matrix.rust == 'stable'
run: cargo fmt -- --check
license:
name: Check copyright/license headers
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py