-
Notifications
You must be signed in to change notification settings - Fork 28
103 lines (93 loc) · 3.15 KB
/
tests.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
name: tests
on:
push:
paths-ignore:
- 'LICENSE-*'
- '**.md'
pull_request:
paths-ignore:
- 'LICENSE-*'
- '**.md'
jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --features bindgen,bundled-4_3_1,vendored -- -D warnings
test-posix:
strategy:
matrix:
os: [ ubuntu-latest ]
target: ["x86_64-unknown-linux-musl", "x86_64-unknown-linux-gnu"]
features: [ "vendored,bindgen", "vendored,bundled-4_3_1" ]
rust: [ stable, nightly ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
# Skip tests containing "proc", they seem to fail randomly on the pipeline.
- name: Test
run: cargo test --verbose --no-default-features --features ${{ matrix.features }},module-hash,module-dotnet,module-dex,module-macho,ndebug -- --skip proc
test-windows:
strategy:
matrix:
os: [ windows-2019 ]
features: [ "vendored,bundled-4_3_1" ]
rust: [ stable ]
cryptolib: [ "WinCrypt", "disabled" ]
runs-on: ${{ matrix.os }}
steps:
- name: Install OpenSSL
if: ${{ matrix.cryptolib == 'OpenSSL' }}
run: choco install openssl
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Test
env:
YARA_CRYPTO_LIB: ${{ matrix.cryptolib }}
# Skip tests containing "proc", they seem to fail randomly on the pipeline.
run: cargo test --verbose --no-default-features --features ${{ matrix.features }},module-hash,module-dotnet,module-dex,module-macho,ndebug -- --skip proc
build-macos:
strategy:
matrix:
os: [ macos-latest ]
features: [ "vendored,bindgen", "vendored,bundled-4_3_1" ]
rust: [ stable, nightly ]
cryptolib: [ "OpenSSL", "CommonCrypto", "disabled" ]
openssl_dir: [ "/usr/local/opt/[email protected]" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Test
env:
YARA_CRYPTO_LIB: '${{ matrix.cryptolib }}'
CFLAGS: '-I ${{ matrix.openssl_dir }}/include'
OPENSSL_LIB_DIR: '${{ matrix.openssl_dir }}/lib'
run: cargo build --verbose --no-default-features --features ${{ matrix.features }},module-hash,module-dotnet,module-dex,module-macho,ndebug