Ubuntu 24.04 #441
Workflow file for this run
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
# This is a basic workflow to help you get started with Actions | ||
name: CI | ||
concurrency: | ||
group: CI | ||
cancel-in-progress: false | ||
# Controls when the workflow will run | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: [ubuntu, mac, windows] | ||
compiler: [gcc, clang, msvc] | ||
include: | ||
# define operating systems | ||
- flavor: ubuntu | ||
os: ubuntu-24.04 | ||
- flavor: mac | ||
os: macos-14 | ||
- flavor: windows | ||
os: windows-latest | ||
# CC | ||
- compiler: msvc | ||
is-experimental: false | ||
- compiler: gcc | ||
CC: gcc-14 | ||
CXX: g++-14 | ||
is-experimental: false | ||
- compiler: clang | ||
CC: clang | ||
CXX: clang++ | ||
CC_LD: lld | ||
CXX_LD: lld | ||
is-experimental: true | ||
# Mac stuff | ||
- DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer | ||
flavor: mac | ||
exclude: | ||
- flavor: windows | ||
compiler: gcc | ||
- flavor: windows | ||
compiler: clang | ||
# - flavor: mac | ||
# compiler: clang | ||
- flavor: mac | ||
compiler: msvc | ||
- flavor: ubuntu | ||
compiler: msvc | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
checks: write | ||
env: | ||
CC: ${{ matrix.CC }} | ||
CXX: ${{ matrix.CXX }} | ||
DEVELOPER_DIR: ${{ matrix.DEVELOPER_DIR }} | ||
DEBEMAIL: ${{ vars.DEBEMAIL }} | ||
DEBFULLNAME: ${{ vars.DEBFULLNAME }} | ||
continue-on-error: ${{ matrix.is-experimental }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- if: ${{ matrix.compiler == 'clang' && matrix.flavor == 'ubuntu' }} | ||
name: Install clang ubuntu | ||
run: | | ||
sudo apt-get install clang libc++-dev libc++abi-dev libstdc++-14-dev libhowardhinnant-date-dev | ||
- if: ${{ matrix.compiler == 'gcc' && matrix.flavor == 'ubuntu' }} | ||
name: Install gcc ubuntu | ||
run: | | ||
sudo apt-get install g++-14 libstdc++-14-dev | ||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 | ||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14 | ||
sudo update-alternatives --set gcc /usr/bin/gcc-14 | ||
sudo update-alternatives --set g++ /usr/bin/g++-14 | ||
- if: ${{ matrix.flavor == 'ubuntu' }} | ||
name: Install deps ubuntu | ||
run: | | ||
sudo add-apt-repository -n ppa:talisein/ctre | ||
sudo add-apt-repository -n ppa:talisein/libboost-ext-ut | ||
sudo add-apt-repository -n ppa:talisein/outcome | ||
sudo apt-get update | ||
sudo apt-get install ninja-build liboutcome-dev libboost-ext-ut-dev libctre-dev libmagicenum-dev jq findutils meson | ||
# python -m pip install meson | ||
- if: ${{ matrix.flavor == 'mac' && matrix.compiler == 'gcc' }} | ||
name: Install deps mac | ||
run: | | ||
brew search gcc@ | ||
brew install meson gcc@14 ninja | ||
- if: ${{ matrix.flavor == 'windows' }} | ||
name: Install Meson/Ninja Windows | ||
run: | | ||
python -m pip install meson | ||
- if: ${{ matrix.flavor == 'windows' }} | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- if: ${{ matrix.flavor == 'ubuntu' && matrix.compiler == 'gcc' && !startsWith(github.ref, 'refs/tags/v') }} | ||
name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
- name: Cache subprojects | ||
id: meson-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: subprojects/packagecache | ||
key: meson-build-cache-${{ runner.os }}-${{ github.run_id }} | ||
enableCrossOsArchive: true | ||
restore-keys: | | ||
meson-build-cache-${{ runner.os }}- | ||
meson-build-cache- | ||
meson-build-cache | ||
- if: ${{ (steps.meson-cache.outputs.cache-hit == 'true') && (matrix.flavor != 'windows') }} | ||
name: List cache | ||
run: ls subprojects/packagecache | ||
continue-on-error: true | ||
- if: ${{ (steps.meson-cache.outputs.cache-hit == 'true') && (matrix.flavor == 'windows') }} | ||
name: List cache | ||
run: dir subprojects/packagecache | ||
continue-on-error: true | ||
- if: ${{ matrix.flavor == 'ubuntu' && !startsWith(github.ref, 'refs/tags/v') }} | ||
name: Configure Ubuntu 24 (Debug) | ||
run: | | ||
meson setup --warnlevel 3 --buildtype debug --default-library static --force-fallback-for libjpeg,libpng build | ||
- if: ${{ matrix.flavor == 'ubuntu' && startsWith(github.ref, 'refs/tags/v') }} | ||
name: Configure Ubuntu 24 (Release) | ||
run: | | ||
meson setup --warnlevel 3 --buildtype release --default-library static --force-fallback-for libjpeg,libpng build | ||
- if: ${{ matrix.flavor == 'mac' }} | ||
name: Configure MacOS 12 | ||
run: | | ||
meson setup --warnlevel 3 --buildtype release --default-library static -Dcpp_link_args="-static-libstdc++ -static-libgcc" --force-fallback-for libjpeg,libpng -Dcpp-httplib:cpp-httplib_openssl=disabled build | ||
- if: ${{ matrix.flavor == 'windows' }} | ||
name: Configure Windows Latest | ||
run: | | ||
meson setup --warnlevel 3 --buildtype release -Dcpp_std=vc++latest --default-library static -Dcpp_eh=a -Dlibxml2:warning_level=0 -Dminiz:warning_level=0 -Dlibjpeg-turbo:warning_level=0 -Dcpp-httplib:cpp-httplib_openssl=disabled -Dcpp-httplib:cpp_std=vc++latest -Dlibxmlpp:build-tests=false -Dlibxml2:python=disabled -Dlibxml2:iconv=disabled --force-fallback-for libpng build | ||
- name: Compile | ||
run: ninja -C build | ||
- if: ${{ matrix.flavor == 'ubuntu' }} | ||
name: ldd ubuntu | ||
run: | | ||
meson introspect --targets build | jq '.[] | select(.type == "executable" and .subproject == null) | .filename[]' | xargs ldd | ||
continue-on-error: true | ||
- if: ${{ matrix.flavor == 'mac' }} | ||
name: ldd macos | ||
run: otool -L build/src/dregarnuhr | ||
continue-on-error: true | ||
- if: ${{ matrix.flavor == 'windows' }} | ||
name: ldd windows | ||
run: dumpbin /DEPENDENTS build/src/dregarnuhr.exe | ||
continue-on-error: true | ||
- name: Test | ||
id: unittests | ||
run: meson test -C build --print-errorlogs | ||
- name: Test Reporter | ||
uses: dorny/[email protected] | ||
if: ${{ always() }} | ||
continue-on-error: true | ||
with: | ||
name: Unit tests ${{ matrix.os }} ${{ matrix.compiler }} | ||
path: 'build/meson-logs/testlog.junit.xml,build/*junit.xml' | ||
reporter: java-junit | ||
fail-on-error: false | ||
- if: ${{ steps.unittests.conclusion == 'failure' && failure() }} | ||
name: Test backtrace | ||
run: | | ||
sudo apt-get install gdb | ||
gdb --batch -ex "run" -ex "bt full" -ex "quit" --args build/src/utils_test | ||
gdb --batch -ex "run" -ex "bt full" -ex "quit" --args build/src/volumes_test | ||
- name: Save logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: meson-log ${{ matrix.os }} ${{ matrix.compiler }} | ||
path: | | ||
build/meson-logs/meson-log.txt | ||
build/meson-logs/testlog.txt | ||
if-no-files-found: ignore | ||
retention-days: 5 | ||
- if: ${{ matrix.flavor == 'ubuntu' && matrix.compiler == 'gcc' && !startsWith(github.ref, 'refs/tags/v') }} | ||
name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
# Generate tarball for PPA | ||
- if: ${{ matrix.flavor == 'ubuntu' && matrix.compiler == 'gcc' && startsWith(github.ref, 'refs/tags/v') }} | ||
name: Get debuild dependencies | ||
run: | | ||
sudo add-apt-repository -n ppa:talisein/libxml++5.0 | ||
sudo add-apt-repository -n ppa:talisein/miniz | ||
sudo apt-get update | ||
sudo apt-get install cmake libcpp-httplib-dev libxml++5.0-dev libminiz3-dev debmake debhelper devscripts equivs distro-info-data distro-info dpkg-dev git-buildpackage | ||
- if: ${{ matrix.flavor == 'ubuntu' && matrix.compiler == 'gcc' && startsWith(github.ref, 'refs/tags/v') }} | ||
name: Generate PPA tarball | ||
run: | | ||
git config user.email "$DEBEMAIL" | ||
git config user.name "$DEBFULLNAME" | ||
gbp dch --ignore-branch -c -R --spawn-editor=never | ||
meson dist -C build --no-tests --formats gztar | ||
cd build/meson-dist | ||
tar -xf dregarnuhr*.tar.gz | ||
- if: ${{ matrix.flavor == 'ubuntu' && matrix.compiler == 'gcc' && startsWith(github.ref, 'refs/tags/v') }} | ||
name: Publish PPA Snapshot | ||
continue-on-error: true | ||
env: | ||
LD_PRELOAD: | ||
GPG_PRIVATE_KEY: ${{ secrets.PPA_PGP_SECRET_KEY }} | ||
DEB_GPG_PASSPHRASE: ${{ secrets.PPA_PGP_PASSPHRASE }} | ||
DEB_SIGN_KEYID: ${{ secrets.PPA_PGP_KEY_ID }} | ||
REPOSITORY: ppa:talisein/dregarnuhr | ||
run: | | ||
cd build/meson-dist/dregarnuhr*/ | ||
echo "$GPG_PRIVATE_KEY" | gpg --batch --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --import | ||
debmake | ||
debuild -S -p"gpg --batch --no-tty --status-fd 1 --with-colons --passphrase "$DEB_GPG_PASSPHRASE" --pinentry-mode loopback" --force-sign -sa | ||
dput $REPOSITORY ../*.changes | ||
# Capture the binary | ||
- if: ${{ matrix.flavor != 'windows' && (success() || failure()) }} | ||
name: Binary Ubuntu/Mac | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dregarnuhr-${{ matrix.os }}-${{ matrix.compiler }} | ||
path: build/src/dregarnuhr | ||
- if: ${{ matrix.flavor == 'windows' && (success() || failure()) }} | ||
name: Binary Windows | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dregarnuhr-${{ matrix.os }} | ||
path: build/src/dregarnuhr.exe | ||
check-run-linux: | ||
needs: build | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- run: | | ||
chmod u+x dregarnuhr-ubuntu-24.04-gcc/dregarnuhr | ||
dregarnuhr-ubuntu-24.04-gcc/dregarnuhr --check --verbose | ||
check-run-macos-14: | ||
needs: build | ||
runs-on: macos-14 | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- run: | | ||
chmod u+x dregarnuhr-macos-14-gcc/dregarnuhr | ||
dregarnuhr-macos-14-gcc/dregarnuhr --check --verbose | ||
check-run-macos-14-clang: | ||
needs: build | ||
runs-on: macos-14 | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- run: | | ||
chmod u+x dregarnuhr-macos-14-clang/dregarnuhr | ||
dregarnuhr-macos-14-clang/dregarnuhr --check --verbose | ||
check-run-win: | ||
needs: build | ||
runs-on: windows-latest | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- run: dregarnuhr-windows-latest/dregarnuhr.exe --check --verbose | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [check-run-linux, check-run-macos-12, check-run-win] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- id: myref | ||
env: | ||
REF: ${{ github.event.ref }} | ||
run: echo "::set-output name=MYREF::`echo $REF | cut -b 11-`" | ||
- run: chmod u+x dregarnuhr-ubuntu-24.04-gcc/dregarnuhr | ||
- run: tar -C ./dregarnuhr-ubuntu-24.04-gcc -cJvf "dregarnuhr-linux-${{ steps.myref.outputs.MYREF }}.tar.xz" dregarnuhr | ||
- run: chmod u+x dregarnuhr-macos-12-gcc/dregarnuhr | ||
- run: tar -C ./dregarnuhr-macos-12-gcc -czvf "dregarnuhr-mac-${{ steps.myref.outputs.MYREF }}.tar.gz" dregarnuhr | ||
- run: zip -j "./dregarnuhr-windows-${{ steps.myref.outputs.MYREF }}.zip" dregarnuhr-windows-latest/dregarnuhr.exe | ||
- run: ls | ||
- name: Release Linux Artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dregarnuhr-linux-${{ steps.myref.outputs.MYREF }}.tar.xz | ||
asset_name: dregarnuhr-ubuntu24.04-${{ steps.myref.outputs.MYREF }}.tar.xz | ||
asset_content_type: application/x-xz | ||
- name: Release Mac Artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dregarnuhr-mac-${{ steps.myref.outputs.MYREF }}.tar.gz | ||
asset_name: dregarnuhr-mac-${{ steps.myref.outputs.MYREF }}.tar.gz | ||
asset_content_type: application/gzip | ||
- name: Release Windows Artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dregarnuhr-windows-${{ steps.myref.outputs.MYREF }}.zip | ||
asset_name: dregarnuhr-windows-${{ steps.myref.outputs.MYREF }}.zip | ||
asset_content_type: application/zip |