Merge pull request #1496 from contour-terminal/fix/ssh_better_feedback #6694
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-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Checking for open PR-related TODO items" | |
run: ./scripts/check-pr-todos.sh | |
check_clang_format: | |
name: "Check C++ style" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install clang | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 17 | |
sudo apt-get install clang-format-17 | |
- name: "Clang-format" | |
run: find ./src/ -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --Werror --dry-run | |
- name: "Check includes" | |
run: ./scripts/check-includes.sh | |
check_clang_tidy: | |
name: "Check clang-tidy" | |
runs-on: ubuntu-22.04 | |
if: github.ref != 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: "ccache-ubuntu2204-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: sudo apt install -y clang-15 clang-tidy-15 | |
- name: "cmake" | |
run: | | |
cmake \ | |
-DCMAKE_BUILD_TYPE="Debug" \ | |
-DCMAKE_CXX_COMPILER="clang++-15" \ | |
-DCONTOUR_INSTALL_TOOLS=ON \ | |
-DCONTOUR_QT_VERSION=6 \ | |
-DCONTOUR_TESTING=ON \ | |
-DENABLE_TIDY=OFF \ | |
-DLIBTERMINAL_BUILD_BENCH_HEADLESS=ON \ | |
-DLIBUNICODE_UCD_BASE_DIR=$PWD/_ucd \ | |
-DPEDANTIC_COMPILER=ON \ | |
-DPEDANTIC_COMPILER_WERROR=OFF \ | |
-S . -B build | |
- name: "build libunicode" | |
run: cmake --build build/ --target unicode -- -j3 | |
- uses: ZedThree/clang-tidy-review@v0.17.0 | |
id: review | |
with: | |
lgtm_comment_body: "" | |
annotations: true | |
build_dir: build | |
max_comments: 10 | |
- uses: ZedThree/clang-tidy-review/upload@v0.17.0 # Uploads an artefact containing clang_fixes.json | |
id: upload-review | |
- if: steps.review.outputs.total_comments > 0 # If there are any comments, fail the check | |
run: exit 1 | |
# - name: run clang-tidy | |
# run: | | |
# set -ex | |
# for dir in src/*; do | |
# FILES=$(find $dir -name '*.cpp' -print) | |
# for file in $FILES; do | |
# echo "Checking file $file ..." | |
# clang-tidy \ | |
# -p build \ | |
# -header-filter=$PWD/src \ | |
# $file | |
# done | |
# done | |
check_links: | |
name: "Check links" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: editorconfig-checker/action-editorconfig-checker@main | |
- run: editorconfig-checker | |
# }}} | |
# {{{ ArchLinux | |
archlinux: | |
if: github.ref == 'refs/heads/master' || github.head_ref == 'release' | |
strategy: | |
matrix: | |
arch: | |
[ | |
"linux/amd64 x86_64" | |
] | |
name: "Archlinux ${{ matrix.arch }}" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: Read 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: Build ${{ matrix.arch }} release | |
shell: bash | |
run: | | |
docker buildx build --platform ${{ steps.tags.outputs.PLATFORM }} \ | |
--tag contour:${{ steps.tags.outputs.ARCH }} \ | |
-f .github/archlinux/Dockerfile \ | |
--load \ | |
. | |
docker create --name contour-${{ steps.tags.outputs.ARCH }} contour:${{ steps.tags.outputs.ARCH }} | |
docker cp contour-${{ steps.tags.outputs.ARCH }}:/app/contour.pkg.tar.zst contour-${{ steps.tags.outputs.ARCH }}.pkg.tar.zst | |
docker container rm contour-${{ steps.tags.outputs.ARCH }} | |
- name: "Uploading Archlinux .pkg.tar.zst package" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "contour-${{ steps.tags.outputs.ARCH }}.pkg.tar.zst" | |
path: "contour-${{ steps.tags.outputs.ARCH }}.pkg.tar.zst" | |
if-no-files-found: error | |
retention-days: 1 | |
# }}} | |
# {{{ Fedora | |
fedora: | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: [39] | |
arch: | |
[ | |
"linux/amd64 x86_64" | |
] | |
name: "Fedora ${{ matrix.os_version }} ${{ matrix.arch }}" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
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@v3 | |
- 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 | |
QTVER=6 SYSDEP_ASSUME_YES=ON ./scripts/install-deps.sh | |
mkdir build | |
cmake -DCMAKE_BUILD_TYPE=Debug -DLIBTERMINAL_BUILD_BENCH_HEADLESS=ON -DCONTOUR_QT_VERSION=6 -S . -B build | |
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 | |
osx: | |
name: "macOS" | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
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/ccache-action@v1.2 | |
with: | |
key: ccache-osx_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 }}-osx" | |
mv -vf "build/Contour-${{ steps.set_vars.outputs.VERSION_STRING }}-Darwin.dmg" "${BASENAME}.dmg" | |
- name: upload to artifact store (DMG) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-osx.dmg" | |
path: "contour-${{ steps.set_vars.outputs.version }}-osx.dmg" | |
retention-days: 7 | |
# }}} | |
# {{{ Windows | |
windows: | |
name: "Windows" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.3 | |
- 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/run-vcpkg@v11.1 | |
id: runvcpkg | |
with: | |
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ | |
vcpkgGitCommitId: 80403036a665cb8fcc1a1b3e17593d20b03b2489 | |
- name: "Generate build files" | |
run: cmake --preset windows-cl-release | |
- 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@v3 | |
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@v3 | |
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 CC matrix | |
ubuntu_2204_cc_matrix: | |
strategy: | |
fail-fast: false | |
matrix: | |
cxx: [20] | |
build_type: ["RelWithDebInfo"] | |
compiler: | |
[ | |
"GCC 10", | |
"Clang 15", | |
] | |
qt_version: [6] | |
name: "Ubuntu Linux 22.04 (${{ matrix.compiler }}, C++${{ matrix.cxx }}, Qt${{ matrix.qt_version }})" | |
runs-on: ubuntu-22.04 | |
outputs: | |
id: "${{ matrix.compiler }} (C++${{ matrix.cxx }}, ${{ matrix.build_type }}, ${{ matrix.qt_version }})" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: "ccache-ubuntu2204-${{ 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: Install CMake | |
uses: ssrobins/install-cmake@v1 | |
- 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 \ | |
--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 10' && matrix.cxx == '20' && matrix.qt_version == '6' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: contour-ubuntu2204-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 22.04 as base). | |
package_for_AppImage: | |
name: "Packaging for AppImage" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: "ccache-ubuntu2004-AppImage" | |
max-size: 256M | |
- name: "Update apt database" | |
run: sudo apt-get update | |
- name: Installing xmllint for ci-set-vars | |
run: sudo apt-get -qy install libxml2-utils | |
- name: Install LinuxDeploy | |
uses: miurahr/install-linuxdeploy-action@v1 | |
with: | |
plugins: qt appimage | |
- name: "set environment variables" | |
id: set_vars | |
run: ./scripts/ci-set-vars.sh | |
env: | |
REPOSITORY: ${{ github.event.repository.name }} | |
- name: set QTVER | |
id: set_qtver | |
run: echo "QTVER=6" >> "$GITHUB_OUTPUT" | |
- 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 | |
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" | |
BUILD_DIR="build" \ | |
CMAKE_BUILD_TYPE=RelWithDebInfo \ | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS \ | |
-DCMAKE_CXX_STANDARD=$CMAKE_CXX_STANDARD \ | |
-DCMAKE_INSTALL_PREFIX="$(pwd)/AppDir" \ | |
-DCONTOUR_TESTING=ON \ | |
" \ | |
./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: "install libfuse2 (Dependency of AppImage programs)" | |
run: sudo apt -qy install libfuse2 | |
- name: "linuxdeploy: Creating AppImage" | |
run: | | |
set -ex | |
cmake --build --preset linux-release --target install | |
# NB: The appdir path must be given absolute rather than relative, as otherwise the qt plugin won't work. | |
QML_SOURCES_PATHS=./src/contour/ui QMAKE=qmake6 DEBUG=1 QT_SELECT=6 linuxdeploy-x86_64.AppImage --output=appimage --appdir AppDir -e ./AppDir/bin/contour --plugin qt --icon-file=./AppDir/share/icons/hicolor/512x512/apps/org.contourterminal.Contour.png --desktop-file=./AppDir/share/applications/org.contourterminal.Contour.desktop | |
mv -v Contour-x86_64.AppImage contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage | |
- name: "Testing AppImage" | |
run: ./contour-${{ steps.set_vars.outputs.VERSION_STRING }}.AppImage version | |
- name: "Uploading AppImage" | |
uses: actions/upload-artifact@v3 | |
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 20.04 / 22.04 | |
package_for_Ubuntu: | |
name: "Packaging for Ubuntu ${{ matrix.os_version }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ['20.04', '22.04'] | |
runs-on: ubuntu-${{ matrix.os_version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- 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/ccache-action@v1.2 | |
with: | |
key: "ccache-ubuntu-${{ matrix.os_version }}" | |
max-size: 256M | |
- name: set QTVER | |
id: set_qtver | |
run: | | |
if [[ ${{ matrix.os_version }} = "20.04" ]]; then | |
echo "QTVER=5" >> "$GITHUB_OUTPUT" | |
fi | |
- name: "Install gcc-10 on 20.04" | |
if: matrix.os_version == '20.04' | |
run: sudo apt -y install gcc-10 | |
- 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 | |
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 | |
if [[ "${{ matrix.os_version }}" = "20.04" ]]; then | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=5 -DCMAKE_CXX_COMPILER=g++-10" | |
else | |
# use Qt6 for 22.04 | |
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=6" | |
fi | |
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 \ | |
" \ | |
./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@v3 | |
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 22.04: test via valgrind | |
test_ubuntu2204_valgrind: | |
name: "Run tests via valgrind" | |
runs-on: ubuntu-22.04 | |
needs: [ubuntu_2204_cc_matrix] | |
steps: | |
- name: "download artifact" | |
uses: actions/download-artifact@v3 | |
with: | |
name: contour-ubuntu2204-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: | | |
set -ex | |
ls -hlR | |
sudo apt install -y \ | |
libfontconfig1 \ | |
libfreetype6 \ | |
libharfbuzz0b \ | |
libqt5gui5 \ | |
libqt5opengl5 \ | |
libyaml-cpp0.7 \ | |
ncurses-bin \ | |
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 22.04: Test bench-headless | |
test_ubuntu2204_bench_headless: | |
strategy: | |
matrix: | |
test_case: | |
[ | |
"grid cat", | |
"grid long" | |
] | |
name: "Run bench-headless" | |
runs-on: ubuntu-22.04 | |
needs: [ubuntu_2204_cc_matrix] | |
steps: | |
- name: "download artifact" | |
uses: actions/download-artifact@v3 | |
with: | |
name: contour-ubuntu2204-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: | | |
set -ex | |
ls -hlR | |
sudo apt install -y \ | |
libfontconfig1 \ | |
libfreetype6 \ | |
libharfbuzz0b \ | |
libqt5gui5 \ | |
libqt5opengl5 \ | |
libyaml-cpp0.7 \ | |
ncurses-bin \ | |
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_ubuntu2204_matrix_test_matrix: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
name: "Ubuntu Linux 22.04 post-check" | |
needs: | |
- package_for_Ubuntu | |
- ubuntu_2204_cc_matrix | |
- test_ubuntu2204_valgrind | |
- test_ubuntu2204_bench_headless | |
steps: | |
- name: Print matrix status | |
run: | | |
echo "Result (CC matrix) : ${{ needs.ubuntu_2204_cc_matrix.result }}" | |
echo "Result (packaging matrix) : ${{ needs.package_for_Ubuntu.result }}" | |
- name: Check build matrix status | |
if: ${{ needs.ubuntu_2204_cc_matrix.result != 'success' && needs.ubuntu_2204_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-ubuntu2204-tests" | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: contour-ubuntu2204-tests | |
# }}} | |
# {{{ Build notcurses | |
build_notcurses: | |
name: "Build notcurses" | |
strategy: | |
fail-fast: false | |
matrix: | |
os_version: ['20.04', '22.04'] | |
runs-on: ubuntu-${{ matrix.os_version }} | |
steps: | |
- name: "update APT database" | |
run: sudo apt -q update | |
- name: "install dependencies" | |
run: | | |
set -ex | |
sudo apt install -y \ | |
build-essential \ | |
cmake \ | |
doctest-dev \ | |
ffmpeg \ | |
libavcodec-dev \ | |
libavdevice-dev \ | |
libavformat-dev \ | |
libavutil-dev \ | |
libdeflate-dev \ | |
libncurses-dev \ | |
libqrcodegen-dev \ | |
libswscale-dev \ | |
libunistring-dev \ | |
xvfb | |
- name: "git clone" | |
run: git clone https://github.com/dankamongmen/notcurses.git | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: ccache-ubuntu_2204-notcurses | |
max-size: 256M | |
- name: "configure cmake" | |
run: | | |
cmake -DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=~/opt/notcurses \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-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 --build notcurses/build --config Release --target install/strip | |
- name: "Uploading artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "notcurses-install-${{ matrix.os_version }}" | |
path: ~/opt/notcurses | |
if-no-files-found: error | |
retention-days: 1 | |
# }}} | |
# {{{ 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: ['20.04', '22.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@v3 | |
- 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@v3 | |
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@v3 | |
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-22.04 | |
needs: [package_for_Ubuntu, build_notcurses] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: # {{{ (name, id) tuples | |
# ixetunchmdbkywjgarvlsfqzo | |
- name: 'aanimate' | |
id: 'a' | |
- name: 'box' | |
id: 'b' | |
- name: 'chunli' | |
id: 'c' | |
- name: 'dragon' | |
id: 'd' | |
- name: 'eagle' | |
id: 'e' | |
- name: 'fission' | |
id: 'f' | |
- name: 'grid' | |
id: 'g' | |
- name: 'highcon' | |
id: 'h' | |
- name: 'intro' | |
id: 'i' | |
- name: 'jungle' | |
id: 'j' | |
- name: 'keller' | |
id: 'k' | |
- name: 'luigi' | |
id: 'l' | |
- name: 'mojibake' | |
id: 'm' | |
- name: 'normal' | |
id: 'n' | |
- name: 'outro' | |
id: 'o' | |
- name: 'qrcode' | |
id: 'q' | |
- name: 'reel' | |
id: 'r' | |
- name: 'sliders' | |
id: 's' | |
- name: 'trans' | |
id: 't' | |
- name: 'uniblock' | |
id: 'u' | |
- name: 'view' | |
id: 'v' | |
- name: 'whiteout' | |
id: 'w' | |
- name: 'xray' | |
id: 'x' | |
- name: 'yield' | |
id: 'y' | |
- name: 'zoo' | |
id: 'z' | |
# }}} | |
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@v3 | |
- 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@v3 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu22.04-amd64.deb" | |
- uses: actions/download-artifact@v3 | |
with: | |
name: "notcurses-install-22.04" | |
path: ~/opt/notcurses | |
- name: "fix executable bits" | |
run: | | |
chmod 0755 ~/opt/notcurses/bin/* | |
chmod 0755 ~/opt/*/lib/* | |
ls -hlR ~/opt/ | |
- name: "install dependencies" | |
run: ./scripts/ci/notcurses-install-deps.sh | |
- name: "Run notcurses-demo -h" | |
timeout-minutes: 1 | |
run: ~/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 }}-ubuntu22.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: | | |
# export LD_LIBRARY_PATH="/home/runner/opt/notcurses/lib" | |
./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@v3 | |
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: ['20.04', '22.04'] | |
runs-on: ubuntu-${{ matrix.os_version}} | |
needs: [package_for_Ubuntu] | |
steps: | |
- uses: actions/checkout@v3 | |
- 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@v3 | |
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@v3 | |
- 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 | |
- archlinux | |
- check_notcurses_test_matrix | |
- fedora | |
- osx | |
- 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@v3 | |
- 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 20.04" | |
uses: actions/download-artifact@v3 | |
with: | |
name: contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu20.04-amd64.deb | |
- name: "fetch artifact: Ubuntu 22.04" | |
uses: actions/download-artifact@v3 | |
with: | |
name: contour-${{ steps.set_vars.outputs.VERSION_STRING }}-ubuntu22.04-amd64.deb | |
- name: "fetch artifact: Fedora 39" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.VERSION }}-1.fc39.x86_64.rpm" | |
- name: "fetch artifact: ArchLinux" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "contour-x86_64.pkg.tar.zst" | |
- name: "fetch artifact: MacOS" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-osx.dmg" | |
- name: "fetch artifact: Windows (MSI)" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.msi" | |
- name: "fetch artifact: Windows (ZIP)" | |
uses: actions/download-artifact@v3 | |
with: | |
name: "contour-${{ steps.set_vars.outputs.version }}-win64.zip" | |
# }}} | |
- 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 | |
*.rpm | |
*.dmg | |
*.msi | |
*.zst | |
*.zip | |
*.AppImage | |
# }}} |