Switch to TerminalSessionManager everywhere and fix small bug #7528
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
name: Build | |
on: | |
merge_group: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/*.yml' | |
- 'LICENSE.txt' | |
- 'mkdocs.yml' | |
- '*.md' | |
- '*.sh' | |
branches: | |
- master | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/*.yml' | |
- 'LICENSE.txt' | |
- 'mkdocs.yml' | |
- '*.md' | |
- '*.sh' | |
branches: | |
- master | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
SCCACHE_GHA_ENABLED: "true" | |
jobs: | |
# {{{ Common checks | |
check_common: | |
name: "Check CI scripts" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Checking for common errors in build, deployment, and CI." | |
run: ./scripts/check-common.sh | |
check_PR_TODOs: | |
name: "Check PR-TODOs" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Checking for open PR-related TODO items" | |
run: ./scripts/check-pr-todos.sh | |
check_spelling: | |
name: Check spelling | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
actions: read | |
security-events: write | |
outputs: | |
followup: ${{ steps.spelling.outputs.followup }} | |
steps: | |
- uses: check-spelling/[email protected] | |
name: Check spelling | |
id: spellcheck | |
with: | |
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} | |
checkout: true | |
check_file_names: 1 | |
spell_check_this: contour-terminal/contour@master | |
post_comment: 0 | |
use_magic_file: 1 | |
report-timing: 1 | |
warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check,unclosed-block-ignore-begin,unclosed-block-ignore-end | |
check_extra_dictionaries: "" | |
dictionary_source_prefixes: > | |
{ | |
"cspell": "https://raw.githubusercontent.com/check-spelling/cspell-dicts/v20241114/dictionaries/" | |
} | |
extra_dictionaries: | | |
cspell:aws/aws.txt | |
cspell:cpp/compiler-clang-attributes.txt | |
cspell:cpp/compiler-msvc.txt | |
cspell:cpp/ecosystem.txt | |
cspell:cpp/lang-keywords.txt | |
cspell:cpp/stdlib-c.txt | |
cspell:cpp/stdlib-cmath.txt | |
cspell:cpp/stdlib-cpp.txt | |
cspell:csharp/csharp.txt | |
cspell:css/css.txt | |
cspell:dart/dart.txt | |
cspell:django/django.txt | |
cspell:dotnet/dotnet.txt | |
cspell:filetypes/filetypes.txt | |
cspell:fullstack/fullstack.txt | |
cspell:golang/go.txt | |
cspell:html/html.txt | |
cspell:java/java-terms.txt | |
cspell:java/java.txt | |
cspell:lorem-ipsum/dictionary.txt | |
cspell:mnemonics/mnemonics.txt | |
cspell:node/node.txt | |
cspell:npm/npm.txt | |
cspell:php/php.txt | |
cspell:powershell/powershell.txt | |
cspell:python/common/extra.txt | |
cspell:python/python/python-lib.txt | |
cspell:python/python/python.txt | |
cspell:r/r.txt | |
cspell:software-terms/softwareTerms.txt | |
cspell:typescript/typescript.txt | |
check_clang_format: | |
name: "Check C++ style" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install clang | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 18 | |
sudo apt-get install clang-format-18 | |
- name: "Clang-format" | |
run: find ./src/ -name "*.cpp" -o -name "*.h" | xargs clang-format-18 --Werror --dry-run | |
- name: "Check includes" | |
run: ./scripts/check-includes.sh | |
check_clang_tidy: | |
name: "Check clang-tidy" | |
runs-on: ubuntu-24.04 | |
if: github.ref != 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: "ccache-ubuntu2404-clang-tidy" | |
max-size: 256M | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: "install dependencies" | |
run: sudo env QTVER=6 ./scripts/install-deps.sh | |
- name: "Post-fix embedded dependency permissions." | |
run: sudo find _deps/sources -exec chown $UID {} \; | |
- name: Install clang | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 18 | |
- name: "cmake" | |
run: | | |
cmake --preset linux-debug -B build -G Ninja \ | |
-D CMAKE_CXX_COMPILER="clang++-18" \ | |
-D ENABLE_TIDY=ON -D CLANG_TIDY_EXE=/usr/bin/clang-tidy-18 | |
- name: "build" | |
run: cmake --build build | |
check_links: | |
name: "Check links" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run linksafe | |
uses: Yaraslaut/linksafe@main | |
with: # comma seperated lists | |
# use relative paths, if no dirs specified root dir is scanned | |
ignored_dirs: "_deps" | |
ignored_files: "./scripts/install-deps.sh, | |
./scripts/install-deps.ps1" | |
ignored_links: "https://www.contributor-covenant.org/faq, | |
https://www.contributor-covenant.org, | |
https://flatpak.org/getting.html, | |
https://codeberg.org/dnkl/foot, | |
https://codecov.io/gh/contour-terminal/contour, | |
https://msdn.microsoft.com/zh-cn/library/f4k12ae8, | |
https://msdn.microsoft.com/en-us/library/fzt08www, | |
" | |
editorconfig: | |
name: "Check editorconfig" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: editorconfig-checker/action-editorconfig-checker@main | |
- run: editorconfig-checker | |
# }}} | |
# {{{ StaticBuild | |
staticBuild: | |
if: github.ref == 'refs/heads/master' || github.head_ref == 'release' | |
name: "Static build" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: Build release | |
shell: bash | |
run: | | |
docker buildx build \ | |
--tag static_contour \ | |
--progress=plain \ | |
-f .github/static/DockerUbuntu \ | |
--load \ | |
. | |
docker create --name contour_static static_contour | |
docker cp contour_static:/contour/build/src/contour/contour contour | |
docker container rm contour_static | |
- name: "Uploading static executable" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour" | |
path: "contour" | |
if-no-files-found: error | |
retention-days: 1 | |
# }}} | |
# {{{ Fedora | |
# fedora: | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os_version: [40] | |
# arch: | |
# [ | |
# "linux/amd64 x86_64" | |
# ] | |
# name: "Fedora ${{ matrix.os_version }} ${{ matrix.arch }}" | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Set up Docker Buildx | |
# id: buildx | |
# uses: docker/setup-buildx-action@v2 | |
# with: | |
# version: latest | |
# - name: Read matrix info | |
# id: tags | |
# shell: bash | |
# run: | | |
# arch="${{ matrix.arch }}" | |
# echo "PLATFORM=${arch%% *}" >> "$GITHUB_OUTPUT" | |
# echo "ARCH=${arch##* }" >> "$GITHUB_OUTPUT" | |
# - name: "update APT database" | |
# run: sudo apt -q update | |
# - name: Installing xmllint for ci-set-vars | |
# run: sudo apt -qy install libxml2-utils | |
# - name: set environment variables | |
# id: set_vars | |
# run: ./scripts/ci-set-vars.sh | |
# env: | |
# REPOSITORY: ${{ github.event.repository.name }} | |
# - name: Fetch and unpack embeds | |
# run: ./scripts/install-deps.sh | |
# env: | |
# PREPARE_ONLY_EMBEDS: 'ON' | |
# SYSDEP_ASSUME_YES: 'ON' | |
# OS_OVERRIDE: 'fedora' | |
# - name: "Post-fix embedded dependency permissions." | |
# run: sudo find _deps/sources -exec chown $UID {} \; | |
# - name: prepare distfile | |
# run: | | |
# set -x | |
# PKGNAME="contour-${{ steps.set_vars.outputs.VERSION }}" | |
# DISTDIR="/tmp/dist/${PKGNAME}" | |
# mkdir -p ${DISTDIR} | |
# cp -rvp . ${DISTDIR} | |
# tar czpf ${PKGNAME}.tar.gz -C "/tmp/dist" . | |
# - name: disable pedantic compiler on certain OS versions | |
# # Generally disable -Werror. | |
# #if: ${{ matrix.os_version == 38 || matrix.os_version == 39 }} | |
# run: | | |
# set -ex | |
# #sed -i -e "s/PEDANTIC_COMPILER=ON/PEDANTIC_COMPILER=OFF/" .github/fedora/contour.spec | |
# sed -i -e "s/PEDANTIC_COMPILER_WERROR=ON/PEDANTIC_COMPILER_WERROR=OFF/" .github/fedora/contour.spec | |
# - name: Build ${{ matrix.arch }} release | |
# shell: bash | |
# run: | | |
# set -x | |
# ARCH="${{ steps.tags.outputs.ARCH }}" | |
# VERSION="${{ steps.set_vars.outputs.VERSION }}" | |
# OS_VERSION="${{ matrix.os_version }}" | |
# sed -i -e "s/fedora:35/fedora:${{ matrix.os_version }}/" .github/fedora/Dockerfile | |
# docker buildx build --platform ${{ steps.tags.outputs.PLATFORM }} \ | |
# --tag contour:${ARCH} \ | |
# --build-arg VERSION=${VERSION} \ | |
# --build-arg VERSION_STRING=${VERSION} \ | |
# -f .github/fedora/Dockerfile \ | |
# --load \ | |
# . | |
# docker create --name contour-${ARCH} contour:${ARCH} | |
# docker cp contour-${ARCH}:/app/rpmbuild/RPMS/${ARCH}/contour-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm \ | |
# contour-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm | |
# docker cp contour-${ARCH}:/app/rpmbuild/RPMS/${ARCH}/contour-debuginfo-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm \ | |
# contour-debuginfo-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm | |
# docker cp contour-${ARCH}:/app/rpmbuild/RPMS/${ARCH}/contour-debugsource-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm \ | |
# contour-debugsource-${VERSION}-1.fc${OS_VERSION}.${ARCH}.rpm | |
# docker container rm contour-${{ steps.tags.outputs.ARCH }} | |
# echo "pwd: `pwd`" && ls -hla | |
# - name: "Uploading Fedora RPM package" | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: "contour-${{ steps.set_vars.outputs.VERSION }}-1.fc${{ matrix.os_version }}.${{ steps.tags.outputs.ARCH }}.rpm" | |
# path: | | |
# contour-${{ steps.set_vars.outputs.VERSION }}-1.fc${{ matrix.os_version }}.${{ steps.tags.outputs.ARCH }}.rpm | |
# contour-debuginfo-${{ steps.set_vars.outputs.VERSION }}-1.fc${{ matrix.os_version }}.${{ steps.tags.outputs.ARCH }}.rpm | |
# contour-debugsource-${{ steps.set_vars.outputs.VERSION }}-1.fc${{ matrix.os_version }}.${{ steps.tags.outputs.ARCH }}.rpm | |
# if-no-files-found: error | |
# retention-days: 7 | |
# }}} | |
# {{{ FreeBSD | |
freebsd: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
name: FreeBSD 13 | |
# env: | |
# MYTOKEN: "value1" | |
# MYTOKEN2: "value2" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test in FreeBSD | |
id: test | |
uses: vmactions/freebsd-vm@v1 | |
timeout-minutes: 60 | |
with: | |
envs: 'MYTOKEN MYTOKEN2' | |
usesh: true | |
copyback: false | |
prepare: pkg install -y wget | |
run: | | |
set -ex | |
pwd | |
ls -lah | |
whoami | |
env | |
freebsd-version | |
SYSDEP_ASSUME_YES=ON ./scripts/install-deps.sh | |
cmake -S . -B build -DCONTOUR_TESTING=ON -DLIBUNICODE_USE_STD_SIMD=OFF | |
cmake --build build/ -j2 | |
./build/src/crispy/crispy_test | |
./build/src/vtparser/vtparser_test | |
./build/src/vtbackend/vtbackend_test | |
./build/src/vtrasterizer/vtrasterizer_test | |
rm -rf _deps build | |
# }}} | |
# {{{ OpenBSD | |
openbsd: | |
if: false #github.ref == 'refs/heads/master' || github.head_ref == 'release' | |
runs-on: ubuntu-latest | |
name: OpenBSD 7.5 | |
# env: | |
# MYTOKEN: "value1" | |
# MYTOKEN2: "value2" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test in OpenBSD | |
id: test | |
uses: vmactions/openbsd-vm@v1 | |
timeout-minutes: 60 | |
with: | |
envs: 'MYTOKEN MYTOKEN2' | |
usesh: true | |
copyback: false | |
prepare: pkg_add -DI wget | |
run: | | |
set -ex | |
pwd | |
ls -lah | |
whoami | |
env | |
./scripts/install-deps.sh | |
mkdir build | |
cmake -S . -B build -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_CXX_FLAGS=-I/home/runner/work/contour/contour/_deps/sources/yaml-cpp-0.8.0/include -DCONTOUR_TESTING=ON -DLIBUNICODE_USE_STD_SIMD=OFF | |
cmake --build build/ -j2 | |
./build/src/crispy/crispy_test | |
./build/src/vtparser/vtparser_test | |
./build/src/vtbackend/vtbackend_test | |
./build/src/vtrasterizer/vtrasterizer_test | |
rm -rf _deps build | |
# }}} | |
# {{{ macOS | |
macOSArm: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set variables | |
id: set_vars | |
run: | | |
./scripts/ci-set-vars.sh | |
echo QTVER=6 >> "$GITHUB_OUTPUT" | |
# Please read the following link on how to use MacOS code signing on Github CI: | |
# https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development | |
echo "CODE_SIGN_CERTIFICATE_ID=Developer ID Application: Christian Parpart (6T525MU9UR)" >> "$GITHUB_OUTPUT" | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: Install the Apple certificate and provisioning profile | |
if: github.ref == 'refs/heads/master' || github.head_ref == 'release' | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
# create variables | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# import certificate and provisioning profile from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
# create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
# apply provisioning profile | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ccache-macosArm_qt${{ steps.set_vars.outputs.QTVER }}-r1 | |
max-size: 256M | |
- name: "Install dependencies" | |
# Sometimes, brew thinks it needs to install from source rather than binary. | |
# For Qt this may take ages (many many hours). Let's not waste our CPU credits here, | |
# and limit the run time. | |
timeout-minutes: 15 | |
run: | | |
set -ex | |
#brew update | |
# Trying to work around some Github CI issues causing `brew install` to fail | |
brew uninstall aws-sam-cli azure-cli | |
QTVER=${{ steps.set_vars.outputs.QTVER }} | |
QTVER=${QTVER} ./scripts/install-deps.sh | |
- name: "Create build directory" | |
run: mkdir build | |
- name: "Generate build files" | |
run: | | |
QTVER=${{ steps.set_vars.outputs.QTVER }} | |
cmake . \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCONTOUR_TESTING=ON \ | |
-DCONTOUR_QT_VERSION=${QTVER} \ | |
-DCMAKE_PREFIX_PATH$="$(brew --prefix qt@${QTVER})" \ | |
-DMACDEPLOYQT_EXECUTABLE="$(brew --prefix qt${QTVER})/bin/macdeployqt" \ | |
-DMACDEPLOYQT_QML_WORKAROUND=ON \ | |
-DCODE_SIGN_CERTIFICATE_ID="${{ steps.set_vars.outputs.CODE_SIGN_CERTIFICATE_ID }}" \ | |
-B build/ | |
- name: "Build" | |
run: cmake --build build/ | |
- name: "test: crispy" | |
run: ./build/src/crispy/crispy_test | |
- name: "test: vtparser" | |
run: ./build/src/vtparser/vtparser_test | |
- name: "test: vtbackend" | |
run: ./build/src/vtbackend/vtbackend_test | |
- name: "test: vtrasterizer" | |
run: ./build/src/vtrasterizer/vtrasterizer_test | |
- name: "Create Package(s)" | |
run: | | |
set -ex | |
echo killing...; sudo pkill -9 XProtect >/dev/null || true; # see https://github.com/actions/runner-images/issues/7522 | |
echo waiting...; while pgrep XProtect; do sleep 3; done; | |
cd build; cpack -G DragNDrop --verbose; cd - | |
# cmake --build build --target package-verbose | |
# ls -hl build/ | |
# find build/src/contour/contour.app -print | |
BASENAME="contour-${{ steps.set_vars.outputs.version }}-macOS-arm" | |
mv -vf "build/Contour-${{ steps.set_vars.outputs.VERSION_STRING }}-Darwin.dmg" "${BASENAME}.dmg" | |
- name: upload to artifact store (DMG) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-macOS-arm.dmg" | |
path: "contour-${{ steps.set_vars.outputs.version }}-macOS-arm.dmg" | |
retention-days: 7 | |
macOSx86: | |
runs-on: macos-latest-large | |
if: github.head_ref == 'release' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set variables | |
id: set_vars | |
run: | | |
./scripts/ci-set-vars.sh | |
echo QTVER=6 >> "$GITHUB_OUTPUT" | |
# Please read the following link on how to use MacOS code signing on Github CI: | |
# https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development | |
echo "CODE_SIGN_CERTIFICATE_ID=Developer ID Application: Christian Parpart (6T525MU9UR)" >> "$GITHUB_OUTPUT" | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: Install the Apple certificate and provisioning profile | |
if: github.ref == 'refs/heads/master' || github.head_ref == 'release' | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
# create variables | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# import certificate and provisioning profile from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
# create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
# apply provisioning profile | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ccache-macOSx86_qt${{ steps.set_vars.outputs.QTVER }}-r1 | |
max-size: 256M | |
- name: "Install dependencies" | |
# Sometimes, brew thinks it needs to install from source rather than binary. | |
# For Qt this may take ages (many many hours). Let's not waste our CPU credits here, | |
# and limit the run time. | |
timeout-minutes: 15 | |
run: | | |
set -ex | |
#brew update | |
# Trying to work around some Github CI issues causing `brew install` to fail | |
brew uninstall aws-sam-cli azure-cli | |
QTVER=${{ steps.set_vars.outputs.QTVER }} | |
QTVER=${QTVER} ./scripts/install-deps.sh | |
- name: "Create build directory" | |
run: mkdir build | |
- name: "Generate build files" | |
run: | | |
QTVER=${{ steps.set_vars.outputs.QTVER }} | |
cmake . \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCONTOUR_TESTING=ON \ | |
-DCONTOUR_QT_VERSION=${QTVER} \ | |
-DCMAKE_PREFIX_PATH$="$(brew --prefix qt@${QTVER})" \ | |
-DMACDEPLOYQT_EXECUTABLE="$(brew --prefix qt${QTVER})/bin/macdeployqt" \ | |
-DMACDEPLOYQT_QML_WORKAROUND=ON \ | |
-DCODE_SIGN_CERTIFICATE_ID="${{ steps.set_vars.outputs.CODE_SIGN_CERTIFICATE_ID }}" \ | |
-B build/ | |
- name: "Build" | |
run: cmake --build build/ | |
- name: "test: crispy" | |
run: ./build/src/crispy/crispy_test | |
- name: "test: vtparser" | |
run: ./build/src/vtparser/vtparser_test | |
- name: "test: vtbackend" | |
run: ./build/src/vtbackend/vtbackend_test | |
- name: "test: vtrasterizer" | |
run: ./build/src/vtrasterizer/vtrasterizer_test | |
- name: "Create Package(s)" | |
run: | | |
set -ex | |
echo killing...; sudo pkill -9 XProtect >/dev/null || true; # see https://github.com/actions/runner-images/issues/7522 | |
echo waiting...; while pgrep XProtect; do sleep 3; done; | |
cd build; cpack -G DragNDrop --verbose; cd - | |
# cmake --build build --target package-verbose | |
# ls -hl build/ | |
# find build/src/contour/contour.app -print | |
BASENAME="contour-${{ steps.set_vars.outputs.version }}-macOS-x86" | |
mv -vf "build/Contour-${{ steps.set_vars.outputs.VERSION_STRING }}-Darwin.dmg" "${BASENAME}.dmg" | |
- name: upload to artifact store (DMG) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-macOS-x86.dmg" | |
path: "contour-${{ steps.set_vars.outputs.version }}-macOS-x86.dmg" | |
retention-days: 7 | |
# }}} | |
# {{{ Windows | |
windows: | |
name: "Windows" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: setup environment | |
shell: powershell | |
id: set_vars | |
run: .\scripts\ci-set-vars.ps1 | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: "Fetch embedded dependencies" | |
shell: powershell | |
run: | | |
./scripts/install-deps.ps1 --skip-vcpkg | |
type ./_deps/sources/CMakeLists.txt | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: "6.6.1" | |
#version: "5.15.*" | |
modules: qtmultimedia qt5compat qtshadertools | |
- name: "vcpkg: Install dependencies" | |
uses: lukka/[email protected] | |
id: runvcpkg | |
with: | |
vcpkgDirectory: ${{ runner.workspace }}/vcpkg | |
vcpkgGitCommitId: 80403036a665cb8fcc1a1b3e17593d20b03b2489 | |
- name: "Install cmake" | |
uses: lukka/[email protected] | |
- name: "Check cmake version" | |
run: cmake --version | |
- name: "Generate build files" | |
run: cmake --preset windows-cl-release | |
env: | |
VCPKG_ROOT: "${{ runner.workspace }}/vcpkg" | |
- name: "Build" | |
run: cmake --build --preset windows-cl-release | |
- name: "Test" | |
run: ctest --preset windows-cl-release | |
- name: "Create Package(s)" | |
shell: powershell | |
run: | | |
cpack --preset windows-cl-release -V | |
#type "_CPack_Packages/win64/WIX/wix.log" | |
- name: inspect | |
run: Get-ChildItem -Recurse | |
- name: "Rename package(s)" | |
run: | | |
mv "out\build\windows-cl-release\Contour-${{ steps.set_vars.outputs.version }}-win64.msi" "contour-${{ steps.set_vars.outputs.version }}-win64.msi" | |
mv "out\build\windows-cl-release\Contour-${{ steps.set_vars.outputs.version }}-win64.zip" "contour-${{ steps.set_vars.outputs.version }}-win64.zip" | |
- name: "Inspect again" | |
run: Get-ChildItem | |
- name: "Uploading MSI to artifact store" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.msi" | |
path: "contour-${{ steps.set_vars.outputs.version }}-win64.msi" | |
if-no-files-found: error | |
retention-days: 7 | |
- name: "Uploading ZIP to artifact store" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.zip" | |
path: "contour-${{ steps.set_vars.outputs.version }}-win64.zip" | |
if-no-files-found: error | |
retention-days: 7 | |
# }}} | |
# {{{ Ubuntu 24.04 CC matrix | |
ubuntu_2404_cc_matrix: | |
strategy: | |
fail-fast: false | |
matrix: | |
cxx: [20] | |
build_type: ["RelWithDebInfo"] | |
compiler: | |
[ | |
"GCC 14", | |
"Clang 18", | |
] | |
qt_version: [6] | |
name: "Ubuntu Linux 24.04 (${{ matrix.compiler }}, C++${{ matrix.cxx }}, Qt${{ matrix.qt_version }})" | |
runs-on: ubuntu-24.04 | |
outputs: | |
id: "${{ matrix.compiler }} (C++${{ matrix.cxx }}, ${{ matrix.build_type }}, ${{ matrix.qt_version }})" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: "ccache-ubuntu2404-${{ matrix.compiler }}-${{ matrix.cxx }}-${{ matrix.build_type }}-${{ matrix.qt_version }}" | |
max-size: 256M | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: "Set up output var: CC_VERSION" | |
id: extract_matrix | |
run: | | |
CC_VERSION=$( echo "${{ matrix.compiler }}" | awk '{ print $2; }') | |
echo "CC_VERSION=${CC_VERSION}" >> "$GITHUB_OUTPUT" | |
- name: "Set up QTVER var" | |
id: set_qtver | |
run: | | |
if [[ ${{ matrix.qt_version }} = "5" ]]; then | |
echo "QTVER=5" >> "$GITHUB_OUTPUT" | |
else | |
echo "QTVER=6" >> "$GITHUB_OUTPUT" | |
fi | |
- name: "install dependencies" | |
run: sudo env QTVER="${{ matrix.qt_version }}" SYSDEP_ASSUME_YES=ON ./scripts/install-deps.sh | |
- name: "Post-fix embedded dependency permissions." | |
run: sudo find _deps/sources -exec chown $UID {} \; | |
- name: Install GCC | |
if: ${{ startsWith(matrix.compiler, 'GCC') }} | |
run: sudo apt install -y g++-${{ steps.extract_matrix.outputs.CC_VERSION }} | |
- name: Install Clang | |
if: ${{ startsWith(matrix.compiler, 'Clang') }} | |
run: sudo apt install -y clang-${{ steps.extract_matrix.outputs.CC_VERSION }} #libc++-dev libc++abi-dev | |
- name: Install Clang-Tidy | |
if: ${{ startsWith(matrix.compiler, 'Clang') }} | |
run: sudo apt install -y clang-tidy-${{ steps.extract_matrix.outputs.CC_VERSION }} | |
- name: "create build directory" | |
run: mkdir build | |
- name: CMake version | |
run: cmake --version | |
- name: "cmake" | |
run: | | |
CC_NAME=$(echo "${{ matrix.compiler }}" | awk '{ print tolower($1); }') | |
CC_VER=$( echo "${{ matrix.compiler }}" | awk '{ print $2; }') | |
test "${{ matrix.compiler }}" = "GCC 8" && EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DPEDANTIC_COMPILER_WERROR=ON" | |
test "${CC_NAME}" = "gcc" && CC_EXE="g++" | |
if [[ "${CC_NAME}" = "clang" ]]; then | |
CC_EXE="clang++" | |
# CMAKE_CXX_FLAGS="-stdlib=libc++" | |
# CMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" | |
# EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DENABLE_TIDY=ON" | |
# EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DPEDANTIC_COMPILER_WERROR=OFF" | |
fi | |
cmake \ | |
$EXTRA_CMAKE_FLAGS \ | |
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \ | |
-DCMAKE_CXX_COMPILER="${CC_EXE}-${CC_VER}" \ | |
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \ | |
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \ | |
-DCMAKE_INSTALL_PREFIX="/usr" \ | |
-DCONTOUR_QT_VERSION=${{ matrix.qt_version }} \ | |
-DLIBUNICODE_UCD_BASE_DIR=$PWD/_ucd \ | |
-DPEDANTIC_COMPILER_WERROR=OFF \ | |
--preset linux-debug | |
- name: "build" | |
run: cmake --build --preset linux-debug -- -j3 | |
- name: "tests" | |
run: cmake --build --preset linux-debug --target test | |
- name: "Upload unit tests" | |
if: ${{ matrix.compiler == 'GCC 14' && matrix.cxx == '20' && matrix.qt_version == '6' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: contour-ubuntu2404-tests | |
path: | | |
build/linux-debug/src/crispy/crispy_test | |
build/linux-debug/src/vtparser/vtparser_test | |
build/linux-debug/src/vtbackend/vtbackend_test | |
build/linux-debug/src/vtbackend/bench-headless | |
build/linux-debug/src/vtrasterizer/vtrasterizer_test | |
test/images | |
retention-days: 1 | |
# }}} | |
# {{{ Linux AppImage (Using Ubuntu 24.04 as base). | |
package_for_AppImage: | |
name: "Packaging for AppImage" | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: update APT database | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt-get -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: build inside docker | |
run: | | |
docker buildx build --tag contour-appimage \ | |
-f .github/appimage/Dockerfile --load . | |
docker create --name contour-appimage contour-appimage | |
docker cp contour-appimage:/contour/Contour-latest-x86_64.AppImage contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage | |
docker container rm contour-appimage | |
- name: "set mode" | |
run: sudo chmod +x contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage | |
- name: "libfuse" | |
run: sudo apt-get -qy install libfuse2 | |
- name: "Testing AppImage" | |
run: ./contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage version | |
- name: "Uploading AppImage" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage" | |
path: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage" | |
if-no-files-found: error | |
retention-days: 7 | |
# }}} | |
# {{{ Ubuntu 24.04 | |
package_for_Ubuntu: | |
name: "Packaging for Ubuntu ${{ matrix.os_version }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ['24.04'] | |
runs-on: ubuntu-${{ matrix.os_version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: "ccache-ubuntu-${{ matrix.os_version }}" | |
max-size: 256M | |
- name: "install dependencies" | |
run: sudo env QTVER="${{ steps.set_qtver.outputs.QTVER }}" ./scripts/install-deps.sh | |
- name: "Post-fix embedded dependency permissions." | |
run: sudo find _deps/sources -exec chown $UID {} \; | |
- name: "create build directory" | |
run: mkdir build | |
- name: Install CMake | |
if: matrix.os_version != '24.04' | |
uses: ssrobins/install-cmake@v1 | |
- name: CMake version | |
run: cmake --version | |
- name: "cmake" | |
run: | | |
# TODO: turn on -Werror again, that requires some code changes. | |
CMAKE_CXX_STANDARD=20 | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=6" | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_PACKAGE_TERMINFO=OFF" | |
BUILD_DIR="build" \ | |
CMAKE_BUILD_TYPE=RelWithDebInfo \ | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS \ | |
-DCMAKE_CXX_STANDARD=$CMAKE_CXX_STANDARD \ | |
-DCMAKE_INSTALL_PREFIX="/usr" \ | |
-DCONTOUR_TESTING=ON \ | |
-DPEDANTIC_COMPILER_WERROR=OFF \ | |
" \ | |
./scripts/ci-prepare-contour.sh | |
- name: "build" | |
run: cmake --build --preset linux-release / -- -j3 | |
- name: "tests" | |
run: cmake --build --preset linux-release --target test | |
- name: "CPack: Creating DEB package" | |
run: | | |
set -ex | |
cpack --preset linux-release | |
OS_VERSION=${{ matrix.os_version }} | |
OS_VERSION=${OS_OVERRIDE/./_} | |
mv -v "./build/linux-release/Contour-${{ steps.set_vars.outputs.VERSION_STRING }}-Linux-contour.deb" \ | |
"contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
mv -v "./build/linux-release/Contour-${{ steps.set_vars.outputs.VERSION_STRING }}-Linux-contour-dbgsym.ddeb" \ | |
"contour-dbgsym-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.ddeb" | |
- name: "Uploading artifact .deb package" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
path: | | |
contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb | |
contour-dbgsym-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.ddeb | |
if-no-files-found: error | |
retention-days: 7 | |
- name: "Attempt installing the created .deb" | |
run: | | |
sudo dpkg --install "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
sudo dpkg --install "contour-dbgsym-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.ddeb" | |
# }}} | |
# {{{ Ubuntu 24.04: test via valgrind | |
test_ubuntu2404_valgrind: | |
name: "Run tests via valgrind" | |
runs-on: ubuntu-24.04 | |
needs: [ubuntu_2404_cc_matrix] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
scripts | |
- name: "download artifact" | |
uses: actions/download-artifact@v4 | |
with: | |
name: contour-ubuntu2404-tests | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: "fix unit test permissions" | |
run: | | |
find . -name '*_test' -exec chmod 0755 {} \; | |
find . -name 'bench-headless' -exec chmod 0755 {} \; | |
- name: "install dependencies" | |
run: ./scripts/ci-install-run-deps.sh valgrind | |
- name: "test: crispy (via valgrind)" | |
run: valgrind --error-exitcode=64 ./build/linux-debug/src/crispy/crispy_test | |
- name: "test: vtparser (via valgrind)" | |
run: valgrind --error-exitcode=64 ./build/linux-debug/src/vtparser/vtparser_test | |
- name: "test: vtbackend (via valgrind)" | |
run: valgrind --error-exitcode=64 ./build/linux-debug/src/vtbackend/vtbackend_test | |
- name: "test: vtrasterizer (via valgrind)" | |
run: valgrind --error-exitcode=64 ./build/linux-debug/src/vtrasterizer/vtrasterizer_test | |
# }}} | |
# {{{ Ubuntu 24.04: Test bench-headless | |
test_ubuntu2404_bench_headless: | |
strategy: | |
matrix: | |
test_case: | |
[ | |
"grid cat", | |
"grid long" | |
] | |
name: "Run bench-headless" | |
runs-on: ubuntu-24.04 | |
needs: [ubuntu_2404_cc_matrix] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
scripts | |
- name: "download artifact" | |
uses: actions/download-artifact@v4 | |
with: | |
name: contour-ubuntu2404-tests | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: "fix unit test permissions" | |
run: | | |
find . -name '*_test' -exec chmod 0755 {} \; | |
find . -name 'bench-headless' -exec chmod 0755 {} \; | |
- name: "install dependencies" | |
run: ./scripts/ci-install-run-deps.sh valgrind | |
- name: "bench-headless: ${{ matrix.test_case }}" | |
run: valgrind --error-exitcode=64 ./build/linux-debug/src/vtbackend/bench-headless ${{ matrix.test_case }} size 1 | |
# }}} | |
# {{{ Ubuntu check matrix | |
check_ubuntu2404_matrix_test_matrix: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
name: "Ubuntu Linux 24.04 post-check" | |
needs: | |
- package_for_Ubuntu | |
- ubuntu_2404_cc_matrix | |
- test_ubuntu2404_valgrind | |
- test_ubuntu2404_bench_headless | |
steps: | |
- name: Print matrix status | |
run: | | |
echo "Result (CC matrix) : ${{ needs.ubuntu_2404_cc_matrix.result }}" | |
echo "Result (packaging matrix) : ${{ needs.package_for_Ubuntu.result }}" | |
- name: Check build matrix status | |
if: ${{ needs.ubuntu_2404_cc_matrix.result != 'success' && needs.ubuntu_2404_cc_matrix.result != 'skipped' }} | |
run: exit 1 | |
- name: Check package_for_Ubuntu matrix status | |
if: ${{ needs.package_for_Ubuntu.result != 'success' && needs.package_for_Ubuntu.result != 'skipped' }} | |
run: exit 1 | |
- name: "Delete artifact: contour-ubuntu2404-tests" | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: contour-ubuntu2404-tests | |
# }}} | |
# {{{ GUI: test: contour quick shell exit | |
test_quick_exit: | |
name: "GUI: Quick Shell Exit" | |
needs: [package_for_Ubuntu] | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ['24.04'] | |
runs-on: ubuntu-${{ matrix.os_version }} | |
env: | |
# I'm giving up on eliminating all leaks for now. | |
# There are still some deep inside Qt I can't explain myself if it's because of me. | |
ASAN_OPTIONS: detect_leaks=0 | |
# Can be used to execute contour within a certain environment, such as valgrind: | |
# Valgrind is much more precise, but 10x slower. | |
CONTOUR_PREFIX: "" # valgrind --leak-check=full --num-callers=64 --error-exitcode=112" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
- name: "install dependencies" | |
run: ./scripts/ci/notcurses-install-deps.sh | |
- name: "install contour" | |
run: sudo dpkg -i "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
- name: "contour executable test" | |
run: | | |
contour version | |
contour help | |
- name: "create and patch contour.yml config file" | |
run: | | |
set -ex | |
mkdir -p ~/.config/contour/ | |
contour generate config to ~/.config/contour/contour.yml | |
sed -i -e 's/locator: native/locator: mock/' ~/.config/contour/contour.yml | |
sed -i -e 's/strict_spacing: true/strict_spacing: false/' ~/.config/contour/contour.yml | |
cat .github/mock-font-locator.yml >> ~/.config/contour/contour.yml | |
cat ~/.config/contour/contour.yml | |
- name: "Run Contour: quick exit" | |
timeout-minutes: 5 | |
id: Xvfb-contour | |
run: | | |
./scripts/ci/Xvfb-contour-run.sh \ | |
"quick-exit-dumps/${{ matrix.name }}" \ | |
true | |
- name: "Save dump" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: quick-exit-contour-dump | |
path: quick-exit-dumps | |
if-no-files-found: ignore | |
retention-days: 1 | |
- name: "Check result success" | |
run: | | |
exit ${{ steps.Xvfb-contour.outputs.exitCode }} | |
# }}} | |
# {{{ GUI: external test: notcurses | |
test_notcurses: | |
name: "GUI: notcurses-demo ${{ matrix.name }}" | |
runs-on: ubuntu-24.04 | |
needs: [package_for_Ubuntu] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: # {{{ (name, id) tuples | |
# ixetunchmdbkywjgarvlsfqzo | |
- name: 'aanimate-box-chunli-dragon-eagle-fission-grid-highcon' | |
id: 'abcdefgh' | |
- name: 'intro-junle-keller-luigi-mojibake-normal-outro-qrcode' | |
id: 'ijklmnoq' | |
- name: 'reel-sliders-trans-uniblock-view-whiteout-xray-yield-zoo' | |
id: 'rstuvwxyz' | |
# }}} | |
env: | |
LD_LIBRARY_PATH: /home/runner/opt/notcurses/lib | |
# I'm giving up on eliminating all leaks for now. | |
# There are still some deep inside Qt I can't explain myself if it's because of me. | |
ASAN_OPTIONS: detect_leaks=0 | |
# Can be used to execute contour within a certain environment, such as valgrind: | |
# Valgrind is much more precise, but 10x slower. | |
CONTOUR_PREFIX: "" # valgrind --leak-check=full --num-callers=64 --error-exitcode=112" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu24.04-amd64.deb" | |
- name: "install dependencies" | |
run: ./scripts/ci/notcurses-install-deps.sh | |
- name: "git clone" | |
run: git clone https://github.com/dankamongmen/notcurses.git | |
- name: "configure cmake" | |
run: | | |
cmake -DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=~/opt/notcurses \ | |
-DUSE_CPP=OFF \ | |
-DUSE_DEFLATE=OFF \ | |
-DUSE_MULTIMEDIA=ffmpeg \ | |
-DUSE_PANDOC=OFF \ | |
-DUSE_STATIC=ON \ | |
-S notcurses \ | |
-B notcurses/build | |
- name: "Build notcurses" | |
run: cmake --build notcurses/build/ -- -j3 | |
- name: "Install notcurses" | |
run: cmake --install notcurses/build | |
- name: "Run notcurses-demo -h" | |
timeout-minutes: 1 | |
run: LD_LIBRARY_PATH="/home/runner/opt/notcurses/lib" ~/opt/notcurses/bin/notcurses-demo -p ~/opt/notcurses/share/notcurses -h | |
- name: "install contour" | |
run: sudo dpkg -i "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu24.04-amd64.deb" | |
- name: "contour executable test" | |
run: | | |
contour version | |
contour help | |
ls -hl ~/opt/notcurses/ | |
- name: "create and patch contour.yml config file" | |
run: | | |
set -ex | |
mkdir -p ~/.config/contour/ | |
contour generate config to ~/.config/contour/contour.yml | |
sed -i -e 's/locator: native/locator: mock/' ~/.config/contour/contour.yml | |
sed -i -e 's/strict_spacing: true/strict_spacing: false/' ~/.config/contour/contour.yml | |
cat .github/mock-font-locator.yml >> ~/.config/contour/contour.yml | |
cat ~/.config/contour/contour.yml | |
- name: "Run Contour: notcurses-demo ${{ matrix.name }}" | |
timeout-minutes: 5 | |
id: Xvfb-contour-notcurses | |
run: | | |
./scripts/ci/Xvfb-contour-run.sh \ | |
"notcurses-demo-dumps/${{ matrix.name }}" \ | |
~/opt/notcurses/bin/notcurses-demo \ | |
-p ~/opt/notcurses/share/notcurses ${{ matrix.id }} | |
- name: "Save dump" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: notcurses-contour-dump | |
path: notcurses-demo-dumps | |
if-no-files-found: ignore | |
retention-days: 1 | |
- name: "Check result success" | |
run: | | |
exit ${{ steps.Xvfb-contour-notcurses.outputs.exitCode }} | |
check_notcurses_test_matrix: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
name: tests matrix | |
needs: test_notcurses | |
steps: | |
- name: Check build matrix status | |
if: ${{ needs.test_notcurses.result != 'success' }} | |
run: exit 1 | |
# }}} | |
# {{{ Check Ubuntu package | |
check_package_ubuntu: | |
name: "Check packages for Ubuntu " | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ['24.04'] | |
runs-on: ubuntu-${{ matrix.os_version}} | |
needs: [package_for_Ubuntu] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set environment variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version }}-amd64.deb" | |
- name: "Check install package" | |
run: | | |
sudo apt install "./contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu${{ matrix.os_version}}-amd64.deb" | |
# }}} | |
# {{{ Release | |
check_release: | |
if: github.head_ref == 'release' | |
name: Check Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars.sh and check-release.sh | |
run: sudo apt -qy install libxml2-utils | |
- name: set variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: run release checks | |
run: ./scripts/check-release.sh | |
do_release: | |
if: github.head_ref == 'release' | |
name: Create Github release | |
runs-on: ubuntu-latest | |
needs: | |
- check_links | |
- check_release | |
- check_notcurses_test_matrix | |
- macOSx86 | |
- macOSArm | |
- package_for_Ubuntu | |
- windows | |
permissions: | |
# We need write permissions on contents to create GitHub releases and on | |
# discussions to create the release announcement in the discussion forums | |
contents: write | |
discussions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt -qy install libxml2-utils | |
- name: set variables | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
# {{{ fetch release artifacts | |
- name: "fetch artifact: Ubuntu 24.04" | |
uses: actions/download-artifact@v4 | |
with: | |
name: contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu24.04-amd64.deb | |
- name: "fetch artifact: MacOS (ARM)" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-macOS-arm.dmg" | |
- name: "fetch artifact: MacOS (x86)" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-macOS-x86.dmg" | |
- name: "fetch artifact: Windows (MSI)" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.msi" | |
- name: "fetch artifact: Windows (ZIP)" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.zip" | |
- name: "fetch artifact: AppImage" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}.AppImage" | |
- name: "fetch artifact: Static build" | |
uses: actions/download-artifact@v4 | |
with: | |
name: "contour" | |
# }}} | |
- name: "inspect" | |
run: ls -lisahF | |
- name: inspect recurse | |
run: pwd; ls -hlaR | |
# ------------------------------------------------------------- | |
- name: Create Github release page | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token provided by Actions | |
with: | |
tag_name: v${{ steps.set_vars.outputs.version }}${{ steps.set_vars.outputs.tag_suffix}} | |
name: Contour ${{ steps.set_vars.outputs.version }} ${{ steps.set_vars.outputs.RELEASENAME_SUFFIX}} | |
body_path: ${{ github.workspace }}/release-body.md | |
draft: true | |
prerelease: ${{ steps.set_vars.outputs.IS_PRERELEASE }} | |
fail_on_unmatched_files: true | |
files: | | |
*.deb | |
*.ddeb | |
*.dmg | |
*.msi | |
*.zip | |
*.AppImage | |
# }}} |