-
Notifications
You must be signed in to change notification settings - Fork 3
161 lines (140 loc) · 4.48 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
159
160
161
name: CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '45 4 * * 3'
env:
RUSTFLAGS: -Dwarnings
jobs:
test-linux:
name: Test ${{matrix.build}}
runs-on: ubuntu-22.04
steps:
- name: Install openssl x86 and 32 support for gcc
if: ${{ matrix.build == 'linux32' }}
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libssl-dev:i386 gcc-multilib libc6:i386 libgcc-s1:i386
echo "OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV
echo "OPENSSL_LIB_DIR=/usr/lib/i386-linux-gnu" >> $GITHUB_ENV
echo "YARA_OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{matrix.target}}
- run: cargo test --target=${{matrix.target}}
env:
YARA_CRYPTO_LIB: openssl
- run: cargo test --features authenticode --target=${{matrix.target}}
env:
YARA_CRYPTO_LIB: openssl
strategy:
fail-fast: false
matrix:
build: [linux, linux32]
include:
- build: linux
target: x86_64-unknown-linux-gnu
- build: linux32
target: i686-unknown-linux-gnu
test-windows:
name: Test ${{matrix.build}}
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Install OpenSSL on windows
uses: lukka/run-vcpkg@v10
id: runvcpkg
env:
VCPKG_DEFAULT_TRIPLET: ${{matrix.vcpkg_triplet}}
VCPKG_INSTALLED_DIR: '${{ runner.workspace }}/vcpkg/installed'
with:
appendedCacheKey: ${{matrix.vcpkg_triplet}}
vcpkgDirectory: '${{ runner.workspace }}/vcpkg'
vcpkgGitCommitId: '163fe7bd3d67c41200617caaa245b5ba2ba854e6'
runVcpkgInstall: true
- name: Export VCPKGRS_TRIPLET and OPENSSL_DIR env var
shell: bash
run: |
echo "VCPKGRS_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "OPENSSL_DIR=${{ runner.workspace }}\\vcpkg\\installed\\${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "YARA_OPENSSL_DIR=${{ runner.workspace }}\\vcpkg\\installed\\${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
echo "YARA_CRYPTO_LIB=openssl" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{matrix.target}}
- name: Run tests
env:
YARA_CRYPTO_LIB: openssl
run: cargo test --target=${{matrix.target}}
- name: Run tests with Openssl
env:
YARA_CRYPTO_LIB: openssl
run: cargo test --features authenticode --target=${{matrix.target}}
strategy:
fail-fast: false
matrix:
build: [windows, windows32]
include:
- build: windows
vcpkg_triplet: x64-windows-static
target: x86_64-pc-windows-msvc
- build: windows32
vcpkg_triplet: x86-windows-static
target: i686-pc-windows-msvc
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --tests --all-features
rustmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
deny:
name: Deny
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
coverage:
name: Coverage
runs-on: ubuntu-22.04
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --features authenticode --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
msrv:
name: Rust 1.62.0
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/[email protected]
# Only check boreal (and boreal-parser).
# boreal-cli is a useful tool, but MSRV on it is not really useful.
- run: |
cd boreal
cargo check --all-features