CI #273
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |