Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,49 @@ jobs:
name: "Update packages"
command: sudo pacman -Syu --noconfirm
- run:
name: "Install git"
command: sudo pacman -S --noconfirm git
name: "Install Git and SSH"
command: sudo pacman -S --noconfirm git openssh
- checkout
- run:
name: "Install development packages"
command: |
sudo pacman -S --noconfirm cmake gcc make base-devel curl libprocps
sudo pacman -Ss procps
sudo pacman -S --noconfirm cmake gcc make base-devel curl
- run:
name: "Build library"
command: |
curl https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
git branch
echo "======== RUNNING AUTOREVISION ===="
chmod 777 autorevision
curl -fsSL https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
chmod +x autorevision
./autorevision -t h > autorevision.h
cmake -B build
make -C build
cmake --build build --parallel
cmake --build build --target test

build-debian-linux:
docker:
- image: debian:bullseye
- image: debian:trixie
steps:
- run:
name: "Update packages"
command: |
apt update
apt-get -y upgrade
apt-get update
- run:
name: "Install packages"
command: apt-get -y install libprocps-dev gcc cmake make build-essential git curl
command: apt-get install -y --no-install-recommends ca-certificates openssh-client gcc cmake make build-essential git curl
- checkout
- run:
name: "Build library"
command: |
curl https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
git branch
chmod 777 autorevision
curl -fsSL https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
chmod +x autorevision
./autorevision -t h > autorevision.h
cmake -B build
make -C build
cmake --build build --parallel
cmake --build build --target test

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
build-workflow:
jobs:
- build-manjaro-linux
- build-debian-linux
- build-debian-linux
54 changes: 31 additions & 23 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
name: ubuntults
name: Build (Ubuntu)

on: [push, pull_request]
on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: build-ubuntu-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.systems }}
runs-on: ${{ matrix.systems }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
systems: [ubuntu-20.04,ubuntu-22.04]
systems: [ubuntu-22.04,ubuntu-24.04]

steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -G "Unix Makefiles" -B build
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Generate revision information
shell: bash
- name: Install build dependencies
run: |
sudo apt-get -y install autorevision
autorevision -t h > autorevision.h
sudo apt-get update
sudo apt-get install -y autorevision

- name: Build libhack
run: |
sudo apt-get install libprocps-dev
make
working-directory: build
- name: Generate revision information
run: autorevision -t h > autorevision.h

- name: Configure CMake (examples)
run: |
cp ../../../build/*.so libhack.so
cmake -G "Unix Makefiles" -B build
working-directory: src/examples/linux
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLIBHACK_BUILD_EXAMPLES=ON

- name: Build library and examples
run: cmake --build build --parallel

- name: Build examples
run: make
working-directory: src/examples/linux/build
- name: Run tests
run: cmake --build build --target test
48 changes: 28 additions & 20 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
name: windows
name: Build (Windows)

on: [push, pull_request]
on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: build-windows-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.systems }}
runs-on: ${{ matrix.systems }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
systems: [windows-latest,windows-2019]
systems: [windows-2022,windows-2025]

steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -G "MinGW Makefiles" -B build
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Generate revision information
shell: bash
run: |
curl https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
curl -fsSL https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
chmod +x autorevision
./autorevision -t h > autorevision.h

- name: Build libhack
run: make
working-directory: build
- name: Configure CMake
run: cmake -G "MinGW Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=Release -DLIBHACK_BUILD_EXAMPLES=ON

- name: Configure CMake (examples)
run: |
cp ../../../build/*.dll libhack.dll
cp ../../../build/*.a libhack.a
cmake -G "MinGW Makefiles" -B build
working-directory: src/examples/windows

- name: Build examples
run: make
working-directory: src/examples/windows/build
- name: Build library and examples
run: cmake --build build --parallel

- name: Run tests
run: cmake --build build --target test
104 changes: 94 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,103 @@ on:
tags:
- "v*"

permissions:
contents: read

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: "ubuntu-latest"
package:
name: Package (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- platform: linux-x86_64
os: ubuntu-22.04
- platform: windows-x86_64
os: windows-2025

steps:
- uses: actions/checkout@v2
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get Date
id: date
run: echo "::set-output name=date::$(date +'%m-%d-%Y-%H-%M')"

- name: Make release
uses: "marvinpinto/action-automatic-releases@latest"
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y autorevision

- name: Generate revision information (Linux)
if: runner.os == 'Linux'
run: autorevision -t h > autorevision.h

- name: Generate revision information (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/Autorevision/autorevision/master/autorevision.sh -o autorevision
chmod +x autorevision
./autorevision -t h > autorevision.h

- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: cmake -G "MinGW Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=Release

- name: Build library
run: cmake --build build --parallel

- name: Run tests
run: cmake --build build --target test

- name: Install package
run: cmake --install build --prefix package

- name: Create Linux archive
if: runner.os == 'Linux'
run: tar -czf "libhack-${{ github.ref_name }}-${{ matrix.platform }}.tar.gz" -C package .

- name: Create Windows archive
if: runner.os == 'Windows'
shell: pwsh
run: Compress-Archive -Path package\* -DestinationPath "libhack-${{ github.ref_name }}-${{ matrix.platform }}.zip"

- name: Upload package
uses: actions/upload-artifact@v7
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
name: libhack-${{ matrix.platform }}
path: libhack-${{ github.ref_name }}-${{ matrix.platform }}.*
if-no-files-found: error

publish:
name: Publish GitHub release
needs: package
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
actions: read
contents: write
steps:
- name: Download packages
uses: actions/download-artifact@v8
with:
path: release-assets
merge-multiple: true

- name: Generate checksums
run: sha256sum release-assets/* | tee release-assets/SHA256SUMS

- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ github.ref_name }}" release-assets/* --repo "${{ github.repository }}" --verify-tag --generate-notes
37 changes: 24 additions & 13 deletions .github/workflows/sonarcloud_linux.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,54 @@
name: SonarQube Cloud

on:
push:
branches:
- master
- dev
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: sonar-linux-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and analyze (Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v8.1.0

- name: Setup build environment
run: |
cmake -S . -B build
sudo apt-get -y install autorevision
sudo apt-get update
sudo apt-get install -y autorevision
autorevision -t h > autorevision.h
sudo apt-get install libprocps-dev
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DLIBHACK_ENABLE_COVERAGE=ON

- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug

- name: Run tests to generate coverage statistics
run: |
./build/unit_test
cmake --build build --target test

- name: Run sonar-scanner
- name: SonarQube Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
uses: SonarSource/sonarqube-scan-action@v8.1.0
with:
args: >
--define "sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
Loading