Fix build with newer uClibc-ng #523
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
permissions: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
ref: master | |
fetch-depth: 0 | |
- name: Compile and Test | |
run: | | |
git clone https://github.com/jvoisin/fortify-headers | |
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then | |
export CFLAGS="$CFLAGS -I../fortify-headers -DFORTIFY_PEDANTIC_CHECKS -O3" | |
export LDFLAGS="$LDFLAGS -static" | |
else | |
export CFLAGS="$CFLAGS -I../fortify-headers -D_FORTIFY_SOURCE=3 -DFORTIFY_PEDANTIC_CHECKS -O3" | |
fi | |
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then | |
sudo apt -y install musl-tools | |
make CHECK=1 CC=musl-gcc | |
make clean | |
fi | |
make CHECK=1 CC=gcc | |
make clean | |
make CHECK=1 CC=g++ | |
make clean | |
make CHECK=1 CC=clang | |
make clean | |
make CHECK=1 CC=clang++ | |
make clean | |
make CHECK=1 | |
sudo ./tests/process_iterator_test | |
random_file="$(mktemp $(printf 'X%.0s' $(seq 1 255)))" | |
cp -f ./tests/process_iterator_test ./tests/${random_file} | |
echo "./tests/${random_file}" | |
sudo ./tests/${random_file} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@main | |
with: | |
name: cpulimit-${{ matrix.os }} | |
path: src/cpulimit | |
build-FreeBSD: | |
name: Build on FreeBSD-${{ matrix.osver }}-${{ matrix.arch }} | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
osver: ['13.4', '14.2', '15.0'] | |
arch: ['x86_64', 'aarch64'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Build on FreeBSD | |
uses: vmactions/freebsd-vm@v1 | |
with: | |
release: ${{ matrix.osver }} | |
arch: ${{ matrix.arch }} | |
usesh: true | |
prepare: | | |
pkg install -y gcc llvm gmake sudo git | |
run: | | |
git clone https://github.com/jvoisin/fortify-headers | |
export CFLAGS="$CFLAGS -I../fortify-headers -D_FORTIFY_SOURCE=3 -DFORTIFY_PEDANTIC_CHECKS -O3" | |
gmake CHECK=1 CC=gcc | |
gmake clean | |
gmake CHECK=1 CC=g++ | |
gmake clean | |
gmake CHECK=1 CC=clang | |
gmake clean | |
gmake CHECK=1 CC=clang++ | |
gmake clean | |
gmake CHECK=1 | |
sudo ./tests/process_iterator_test | |
random_file="$(mktemp $(printf 'X%.0s' $(seq 1 255)))" | |
cp -f ./tests/process_iterator_test ./tests/${random_file} | |
echo "./tests/${random_file}" | |
sudo ./tests/${random_file} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@main | |
with: | |
name: cpulimit-FreeBSD-${{ matrix.osver }}-${{ matrix.arch }} | |
path: src/cpulimit |