This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (90 loc) · 2.86 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build and Test
on:
push:
branches:
- main
pull_request: {}
jobs:
cargo-deny:
name: Run cargo deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
ui_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
- name: UI Test with toolchain nightly
uses: actions-rs/cargo@v1
with:
command: test
args: --test ui --features "derive"
build_and_test:
runs-on: ${{ matrix.config.os }}
strategy:
# report each failing OS/toolchain build - useful for separating between OS failures vs. toolchain (nightly) failures
fail-fast: false
matrix:
config:
- os: ubuntu-latest
features: default
- os: macos-latest
features: default
- os: windows-latest
features: rustls-tls
toolchain:
- stable
features:
- "derive"
- "derive-admission-webhook"
steps:
- uses: actions/checkout@v2
- name: Install toolchain ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
default: true
components: clippy, rustfmt
- name: Build with toolchain ${{ matrix.toolchain }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features "${{ matrix.features }} ${{ matrix.config.features }}"
- name: Test with toolchain ${{ matrix.toolchain }}
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --lib --no-default-features --features "${{ matrix.features }} ${{ matrix.config.features }}"
- name: Test admission derive with toolchain ${{ matrix.toolchain }}
uses: actions-rs/cargo@v1
with:
command: test
args: --package krator-derive --test admission --features "admission-webhook"
- name: Test docs with toolchain ${{ matrix.toolchain }}
uses: actions-rs/cargo@v1
with:
command: test
args: --doc --all --no-default-features --features "${{ matrix.features }} ${{ matrix.config.features }}"
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --no-default-features --features "${{ matrix.features }} ${{ matrix.config.features }}"