-
Notifications
You must be signed in to change notification settings - Fork 29
55 lines (49 loc) · 1.49 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CI
on: pull_request
jobs:
ci:
name: ${{ matrix.task.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
task:
- name: Format
command: cargo fmt -- --check
- name: Clippy
command: cargo clippy --all --all-targets --all-features --tests -- -D warnings
- name: Test
command: cargo test
include:
- os: ubuntu-latest
build_deps: scripts/workflows/provision-linux-build.sh
- os: macos-latest
build_deps: scripts/workflows/provision-darwin-build.sh
- os: windows-latest
build_deps: scripts/workflows/provision-windows-build.ps1
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/rust-toolchain.toml') }}-ci-1
- name: Install dependencies
run: ${{ matrix.build_deps }}
- name: ${{ matrix.task.name }}
run: ${{ matrix.task.command }}
aggregate:
name: ci:required
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ci]
steps:
- name: check result
if: ${{ needs.ci.result != 'success' }}
run: exit 1