-
Notifications
You must be signed in to change notification settings - Fork 26
145 lines (120 loc) · 3.41 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Check formatting
shell: pwsh
run: |
Write-Host "Check formatting"
cargo fmt --all -- --check
if ($LastExitCode -eq 1) {
throw "Bad formatting, please run 'cargo +stable fmt --all'"
}
cargo fmt --manifest-path ./ffi/wasm/Cargo.toml -- --check
if ($LastExitCode -eq 1) {
throw "Bad formatting, please run 'cargo +stable fmt --manifest-path ./ffi/wasm/Cargo.toml'"
}
lints:
name: Lints [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
needs: formatting
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-2019
- os: linux
runner: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --locked --workspace --all-features --all-targets -- -D warnings
lints-wasm:
name: Lints [wasm]
runs-on: ubuntu-20.04
needs: formatting
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --locked --all-features --all-targets --manifest-path ./ffi/wasm/Cargo.toml -- -D warnings
- name: Lint picky-ava-tests
shell: pwsh
run: |
Set-Location ./ffi/wasm/ava_tests
npm install
npm run ci
tests:
name: Tests [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
needs: formatting
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-2019
- os: linux
runner: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --locked --verbose --workspace --all-features
msrv:
# Minimum supported Rust version check for published crates.
# If this break, bump crate version minor number.
# See https://github.com/Devolutions/picky-rs/issues/89
name: Check MSRV [${{ matrix.crate }}]
runs-on: ubuntu-20.04
needs: formatting
strategy:
fail-fast: false
matrix:
crate: [ picky-asn1, picky-asn1-der, picky-asn1-x509, picky ]
include:
- crate: picky-asn1
msvc: "1.61"
- crate: picky-asn1-der
msvc: "1.61"
- crate: picky-asn1-x509
msvc: "1.61"
- crate: picky
msvc: "1.65"
steps:
- uses: actions/checkout@v4
- name: Configure runner
run: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain ${{ matrix.msvc }}
- name: cargo check ${{ matrix.crate }}
run: cargo +${{ matrix.msvc }} check -p ${{ matrix.crate }}
success:
name: Success
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- formatting
- lints
- lints-wasm
- tests
- msrv
steps:
- name: CI succeeded
id: succeeded
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0
- name: CI failed
if: ${{ steps.succeeded.outcome == 'skipped' }}
run: exit 1