Skip to content

Commit

Permalink
ci: Use a matrix for all the CMake configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianichitei authored Sep 17, 2024
1 parent ea78026 commit 8c1bc97
Showing 1 changed file with 22 additions and 38 deletions.
60 changes: 22 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ on:
- '*.md'
- 'docs/**'
- 'isagenerator/**'
- 'bddisasm_test/**'
- 'bdshemu_test/**'
- 'LICENSE'
pull_request:
branches: [ master ]
paths-ignore:
- '*.md'
- 'docs/**'
- 'isagenerator/**'
- 'bddisasm_test/**'
- 'bdshemu_test/**'
- 'LICENSE'
release:
types: [published]
Expand All @@ -28,64 +24,52 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
preset: ["debug-sanitizers", "no-mnemonic", "release"]

permissions:
attestations: write
id-token: write
contents: write

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/[email protected]
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/[email protected]
with:
files: 'build/*.deb'
files: 'build/release/*.deb'
repo-token: ${{ secrets.GITHUB_TOKEN }}

Windows-msbuild:
Expand Down

0 comments on commit 8c1bc97

Please sign in to comment.