mirror of
https://github.com/xiaozhou233/ptrace-inject-cpp.git
synced 2026-12-05 13:05:54 +08:00
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: build (${{ matrix.name }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Release assets: built on 22.04 (glibc 2.35) for wider compatibility.
|
|
- { name: ubuntu-22.04-gcc-static, os: ubuntu-22.04, cc: gcc, cxx: g++, shared: "OFF" }
|
|
- { name: ubuntu-22.04-gcc-shared, os: ubuntu-22.04, cc: gcc, cxx: g++, shared: "ON" }
|
|
# Compiler coverage.
|
|
- { name: ubuntu-24.04-clang-static, os: ubuntu-24.04, cc: clang, cxx: clang++, shared: "OFF" }
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build
|
|
env:
|
|
CC: ${{ matrix.cc }}
|
|
CXX: ${{ matrix.cxx }}
|
|
run: |
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
|
|
-DCMAKE_C_FLAGS="-Werror" \
|
|
-DCMAKE_CXX_FLAGS="-Werror"
|
|
cmake --build build --parallel
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ptrace-inject-${{ matrix.name }}
|
|
path: |
|
|
build/libptrace_inject.*
|
|
build/ptrace-inject-cpp
|
|
build/example_by_pid
|
|
build/example_by_name
|
|
build/libptrace_inject_sample.so
|
|
include/ptrace_inject.h
|
|
if-no-files-found: error
|
|
retention-days: 14
|