-
Notifications
You must be signed in to change notification settings - Fork 36
140 lines (115 loc) · 3.39 KB
/
ci.yml
File metadata and controls
140 lines (115 loc) · 3.39 KB
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
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check formatting
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'"
}
shell: pwsh
lints:
name: Lints [${{ matrix.os }}]
needs: [formatting]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run clippy
run: cargo clippy --locked --workspace --all-features --all-targets -- -D warnings
lints-wasm:
name: Lints [wasm]
needs: [formatting]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run clippy
run: cargo clippy --locked --all-features --all-targets --manifest-path ./ffi/wasm/Cargo.toml -- -D warnings
- name: Lint picky-ava-tests
run: |
Set-Location ./ffi/wasm/ava_tests
npm install
npm run ci
shell: pwsh
tests:
name: Tests [${{ matrix.os }}]
needs: [formatting]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [ windows, linux ]
include:
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
steps:
- uses: actions/checkout@v6
- 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 }}]
needs: [formatting]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate: [ picky-asn1, picky-asn1-der, picky-asn1-x509, picky ]
include:
- crate: picky-asn1
msvc: "1.85"
- crate: picky-asn1-der
msvc: "1.85"
- crate: picky-asn1-x509
msvc: "1.85"
- crate: picky
msvc: "1.85"
steps:
- uses: actions/checkout@v6
- 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
if: ${{ always() }}
needs: [formatting, lints, lints-wasm, tests, msrv]
runs-on: ubuntu-latest
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