Simplify CI to three build jobs

This commit is contained in:
xiaozhou233 committed 2026-10-20 13:08:58 +08:00
1 parent 259a4baf29
commit 6acff33c11
1 file changed
+10 -20
+10 -20
View File
@@ -14,47 +14,37 @@ concurrency:
jobs: jobs:
build: build:
name: build (${{ matrix.os }}, ${{ matrix.cc }}, ${{ matrix.build_type }}, ${{ matrix.shared == 'ON' && 'shared' || 'static' }}) name: build (${{ matrix.name }})
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { os: ubuntu-24.04, cc: gcc, cxx: g++, build_type: Release, shared: "OFF" } # Release assets: built on 22.04 (glibc 2.35) for wider compatibility.
- { os: ubuntu-24.04, cc: gcc, cxx: g++, build_type: Debug, shared: "ON" } - { name: ubuntu-22.04-gcc-static, os: ubuntu-22.04, cc: gcc, cxx: g++, shared: "OFF" }
- { os: ubuntu-24.04, cc: clang, cxx: clang++, build_type: Release, shared: "ON" } - { name: ubuntu-22.04-gcc-shared, os: ubuntu-22.04, cc: gcc, cxx: g++, shared: "ON" }
- { os: ubuntu-24.04, cc: clang, cxx: clang++, build_type: Debug, shared: "OFF" } # Compiler coverage.
- { os: ubuntu-22.04, cc: gcc, cxx: g++, build_type: Release, shared: "OFF" } - { name: ubuntu-24.04-clang-static, os: ubuntu-24.04, cc: clang, cxx: clang++, shared: "OFF" }
- { os: ubuntu-22.04, cc: gcc, cxx: g++, build_type: Release, shared: "ON" }
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install compiler - name: Build
if: matrix.cc == 'clang'
run: |
command -v clang >/dev/null && command -v clang++ >/dev/null && exit 0
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang
- name: Configure
env: env:
CC: ${{ matrix.cc }} CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }} CXX: ${{ matrix.cxx }}
run: | run: |
cmake -S . -B build -G Ninja \ cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \ -DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DCMAKE_C_FLAGS="-Werror" \ -DCMAKE_C_FLAGS="-Werror" \
-DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"
cmake --build build --parallel
- name: Build
run: cmake --build build --parallel
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ptrace-inject-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.build_type }}-${{ matrix.shared == 'ON' && 'shared' || 'static' }} name: ptrace-inject-${{ matrix.name }}
path: | path: |
build/libptrace_inject.* build/libptrace_inject.*
build/ptrace-inject-cpp build/ptrace-inject-cpp