Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
migra/.github/workflows/build.yml

99 lines
2.4 KiB
YAML
Raw Normal View History

name: CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- uses: isbang/compose-action@v0.1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: -- --test-threads=1
clippy:
name: clippy (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- name: Instal latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: Check clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
fmt:
name: fmt (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- name: Instal latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check