name: CI
on:
pull_request:
push:
branches:
- master
jobs:
cmake-build-and-tests:
name: >-
CMake build + tests (${{ matrix.image_name }} ${{ matrix.cmake_flags }})
runs-on: ${{ matrix.image_name }}
strategy:
fail-fast: false
matrix:
include:
# Do a regular and a no-libc build for each platform.
- image_name: macOS-latest
cmake_flags: -DZYAN_NO_LIBC=ON
skip_tests: yes
- image_name: windows-2022
- image_name: ubuntu-22.04
# Do a few more specialized configurations.
cmake_flags: -DZYDIS_MINIMAL_MODE=ON -DZYDIS_FEATURE_ENCODER=OFF
cmake_flags: -TClangCL
steps:
- name: Checkout
uses: actions/checkout@v2
with: { submodules: recursive }
- name: Configuring
run: |
mkdir build
cd build
cmake -DZYAN_DEV_MODE=ON ${{ matrix.cmake_flags }} ..
- name: Building
cmake --build build --config Release
- name: Running regression tests (decoder)
cd tests
python3 regression.py test ../build/ZydisInfo
if: "matrix.image_name != 'windows-2022' && !matrix.skip_tests"
- name: Running regression tests (encoder)
python3 regression_encoder.py ../build/ZydisFuzzReEncoding ../build/ZydisFuzzEncoder ../build/ZydisTestEncoderAbsolute
- name: Running regression tests
python regression.py test ..\\build\\Release\\ZydisInfo.exe
if: "matrix.image_name == 'windows-2022' && !matrix.skip_tests"
msbuild-build:
name: MSBuild build (windows-2022)
runs-on: windows-2022
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
with: { vs-version: '[17,]' }
- name: Build user-mode
cd msvc
msbuild.exe Zydis.sln /m /t:Rebuild '/p:Configuration="Release MD";Platform=X64'
- name: Build kernel-mode
msbuild.exe Zydis.sln /m /t:Rebuild '/p:Configuration="Release Kernel";Platform=X64'
amalgamated:
name: Amalgamated build (Ubuntu 22.04)
runs-on: ubuntu-22.04
- name: Amalgamating sources
./assets/amalgamate.py
- name: Compiling library
cd amalgamated-dist
gcc -shared -I. -fPIC -olibzydis.so Zydis.c
fuzzing:
sanitizer: [address, undefined, memory]
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: zydis
dry-run: false
sanitizer: ${{ matrix.sanitizer }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
fuzz-seconds: 600
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success'
name: ${{ matrix.sanitizer }}-artifacts
path: ./out/artifacts