-
Notifications
You must be signed in to change notification settings - Fork 20
182 lines (165 loc) · 4.78 KB
/
test.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build & test
permissions:
contents: write
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
- build: macos
os: macos-latest
- build: windows
os: windows-latest
extension: .exe
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
env:
RUSTFLAGS: -D warnings
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all --exclude mla-fuzz-afl --verbose
- name: Run tests
run: cargo test --all --exclude mla-fuzz-afl --release --verbose
- name: Upload resulting 'mlar'
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.build }}
path: ./target/release/mlar${{ matrix.extension }}
long-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run long tests
run: cd mla && cargo test --release -- --ignored
all-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run long tests
run: cargo test --all-features --all --exclude mla-fuzz-afl --exclude mla-bindings-c --release
test-bindings-c-cpp-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run C bindings tests on Linux
working-directory: bindings/C/tests/linux-gcc-g++/
run: make CC=gcc
- name: Run C bindings tests on Linux
working-directory: bindings/C/tests/linux-gcc-g++/
run: make CC=g++
test-bindings-c-cpp-windows:
strategy:
matrix:
version: [Debug-c, Release-c, Debug-cpp, Release-cpp]
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc]
include:
- version: Debug-c
cargo_arg: ""
- version: Release-c
cargo_arg: --release
- version: Debug-cpp
cargo_arg: ""
- version: Release-cpp
cargo_arg: --release
- target: i686-pc-windows-msvc
msvc_platform: Win32
- target: x86_64-pc-windows-msvc
msvc_platform: x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
# Avoid a regression of Cargo, breaking at link time
toolchain: 1.69
default: true
target: ${{ matrix.target }}
- uses: microsoft/[email protected]
- name: Compile C/CPP bindings test program for Windows
working-directory: bindings/C/tests/windows-msvc/
run: msbuild mla-bindings-test.sln /p:Platform=${{ matrix.msvc_platform }} /p:Configuration=${{ matrix.version }}
- name: Run C/CPP bindings test program on Windows
working-directory: bindings/C/tests/windows-msvc/
run: ./${{ matrix.msvc_platform }}/${{ matrix.version }}/mla-bindings-test.exe
afl-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
run: sudo apt-get install llvm
- name: Install cargo-afl binary crate
uses: actions-rs/[email protected]
with:
crate: afl
version: latest
use-tool-cache: true
- name: Test AFL build
env:
RUSTFLAGS: -D warnings
run: cargo afl build
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Check format
run: cargo fmt --all -- --check
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Security audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- name: Install dependencies
run: sudo apt-get install llvm
- name: Install cargo-afl binary crate
uses: actions-rs/[email protected]
with:
crate: afl
version: latest
use-tool-cache: true
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings