1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-11-21 23:18:09 +00:00

ci: Use a matrix for all the CMake configs

This commit is contained in:
Anichitei Ionel-Cristinel 2024-09-17 14:41:45 +03:00 committed by GitHub
parent ea78026087
commit 8c1bc973d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,6 @@ on:
- '*.md'
- 'docs/**'
- 'isagenerator/**'
- 'bddisasm_test/**'
- 'bdshemu_test/**'
- 'LICENSE'
pull_request:
branches: [ master ]
@ -16,8 +14,6 @@ on:
- '*.md'
- 'docs/**'
- 'isagenerator/**'
- 'bddisasm_test/**'
- 'bdshemu_test/**'
- 'LICENSE'
release:
types: [published]
@ -28,6 +24,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
preset: ["debug-sanitizers", "no-mnemonic", "release"]
permissions:
attestations: write
id-token: write
@ -35,57 +35,41 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build with sanitizers
run: |
mkdir build_sanitizers
cd build_sanitizers
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBDD_ASAN=ON -DBDD_UBSAN=ON
make -j$(nproc)
cd -
- name: Configure CMake
run: cmake --preset ${{ matrix.preset }} -DCMAKE_INSTALL_PREFIX=/usr
- name: Build
run: make -f ./build/${{ matrix.preset }} -j$(nproc)
- name: Test bddisasm
run: python3 ./tests/main.py --disasm ./build_sanitizers/disasmtool/disasmtool --conf ./bddisasm_test/conf-x86.json
run: python3 ./tests/main.py --disasm ./build/${{ matrix.preset }}/disasmtool/disasmtool --conf ./bddisasm_test/conf-x86.json
- name: Test bdshemu
run: python3 ./tests/main.py --disasm ./build_sanitizers/disasmtool/disasmtool --conf ./bdshemu_test/conf-x86.json
- name: Build all
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
cd -
run: python3 ./tests/main.py --disasm ./build/${{ matrix.preset }}/disasmtool/disasmtool --conf ./bdshemu_test/conf-x86.json
- name: Install
run: |
cd build
sudo make install
cd -
- name: Install setuptools
if: ${{ matrix.preset == 'release' }}
run: make -f ./build/${{ matrix.preset }} install
- name: Build pybddisasm
if: ${{ matrix.preset == 'release' }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
- name: Build pybddisasm
run: |
cd bindings/pybddisasm
python3 setup.py build
cd -
- name: Create package
if: ${{ github.event_name == 'release' }}
run: |
cd build
sudo make package
cd -
if: ${{ github.event_name == 'release' && matrix.preset == 'release' }}
run: make -f ./build/${{ matrix.preset }} package
- name: Attest Build Provenance
if: ${{ github.event_name == 'release' }}
if: ${{ github.event_name == 'release' && matrix.preset == 'release' }}
uses: actions/attest-build-provenance@v1.1.0
with:
subject-path: |
build/disasmtool/disasmtool
build/*.a
build/*.deb
build/release/disasmtool/disasmtool
build/release/*.a
build/release/*.deb
- name: Release
if: ${{ github.event_name == 'release' }}
if: ${{ github.event_name == 'release' && matrix.preset == 'release' }}
uses: AButler/upload-release-assets@v3.0
with:
files: 'build/*.deb'
files: 'build/release/*.deb'
repo-token: ${{ secrets.GITHUB_TOKEN }}
Windows-msbuild: