-
Notifications
You must be signed in to change notification settings - Fork 15
158 lines (133 loc) · 3.73 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
146
147
148
149
150
151
152
153
154
155
156
157
158
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@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'"
}
lints:
name: Lints [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
needs: formatting
strategy:
fail-fast: true
matrix:
os: [ win, osx, linux ]
include:
- os: win
runner: windows-2022
additional-args: --features tsssp
- os: osx
runner: macos-12
- os: linux
runner: ubuntu-20.04
steps:
- uses: actions/checkout@v4
# Compiling the ffi module is enough to lint the whole sspi workspace
- name: Check clippy
env:
AWS_LC_SYS_NO_ASM: true
run: cargo clippy --manifest-path ffi/Cargo.toml ${{ matrix.additional-args }} -- -D warnings -D clippy::print_stdout
tests:
name: Tests [${{ matrix.os }}] [${{ matrix.crate-name }}]
runs-on: ${{ matrix.runner }}
needs: formatting
env:
SSPI_RS_IS_RUNNING_TESTS: true
strategy:
fail-fast: true
matrix:
os: [ win, osx, linux ]
manifest: [ Cargo.toml, ffi/Cargo.toml ]
include:
- manifest: Cargo.toml
crate-name: sspi
- manifest: ffi/Cargo.toml
crate-name: sspi-ffi
- os: win
runner: windows-2022
- os: osx
runner: macos-12
- os: linux
runner: ubuntu-20.04
- os: win
manifest: Cargo.toml
additional-args: --features network_client,dns_resolver,scard,tsssp
- os: osx
manifest: Cargo.toml
additional-args: --features network_client,scard
- os: linux
manifest: Cargo.toml
additional-args: --features network_client,dns_resolver,scard
- os: win
manifest: ffi/Cargo.toml
additional-args: --features tsssp
steps:
- uses: actions/checkout@v4
- name: Test
env:
AWS_LC_SYS_NO_ASM: true
run: cargo test --manifest-path ${{ matrix.manifest }} ${{ matrix.additional-args }}
miri:
name: Miri FFI tests
runs-on: ubuntu-20.04
needs: formatting
env:
SSPI_RS_IS_RUNNING_TESTS: true
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain and Miri
run: |
rustup toolchain install nightly --component miri
rustup override set nightly
- name: Test
run: cargo miri test --manifest-path ffi/Cargo.toml --no-default-features --features ring
wasm:
name: WASM target
runs-on: ubuntu-latest
needs: formatting
steps:
- uses: actions/checkout@v4
- name: Prepare runner
run: sudo apt-get install wabt
- name: Check
shell: pwsh
run: ./tools/wasm-testcompile/check.ps1
build-native:
name: Build native
needs: formatting
uses: ./.github/workflows/build-native.yml
success:
name: Success
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- formatting
- lints
- tests
- miri
- wasm
- build-native
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