FreeBSD testing: actually set DISPLAY + kill Xvfb at the end #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches-ignore: | |
- '*travis*' | |
- '*appveyor*' | |
- '*doozer*' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: ${{ matrix.os }} + ${{ matrix.window_manager }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: 'ubuntu-20.04' | |
window_manager: 'kwin' | |
with_test_pod: 'yes' | |
use_xft: 'yes' | |
libpng: 'libpng-dev' | |
libz: 'libz-dev' | |
libjpeg: 'libjpeg-dev' | |
## XXX check later | |
#- os: 'ubuntu-20.04' | |
# window_manager: 'sawfish' | |
# with_test_pod: 'no' | |
# use_xft: 'no' | |
# libpng: '' | |
# libz: '' | |
# libjpeg: '' | |
- os: 'ubuntu-22.04' | |
window_manager: 'fvwm' | |
with_test_pod: 'yes' | |
use_xft: 'yes' | |
libpng: 'libpng-dev' | |
libz: 'libz-dev' | |
libjpeg: 'libjpeg-dev' | |
- os: 'ubuntu-22.04' | |
window_manager: 'twm' | |
with_test_pod: 'no' | |
use_xft: 'no' | |
libpng: '' | |
libz: '' | |
libjpeg: '' | |
steps: | |
- name: apt hacks | |
# removing non-needed apt repositories may speed up "apt-get update" | |
# also, 3rd party repositories might be unreliable | |
run: | | |
sudo rm -f /etc/apt/sources.list.d/*.list | |
sudo apt-get update -qq | |
if: "startsWith(matrix.os, 'ubuntu-')" | |
- uses: actions/checkout@v3 | |
- name: Preinstall | |
env: | |
WINDOW_MANAGER: ${{ matrix.window_manager }} | |
WITH_TEST_POD: ${{ matrix.with_test_pod }} | |
USE_XFT: ${{ matrix.use_xft }} | |
LIBPNG: ${{ matrix.libpng }} | |
LIBZ: ${{ matrix.libz }} | |
LIBJPEG: ${{ matrix.libjpeg }} | |
run: | | |
set -e | |
sudo apt-get install -qq xvfb libx11-dev $([ "$USE_XFT" = "no" ] || echo -n "libfreetype6-dev libxft-dev") $LIBPNG $LIBZ $LIBJPEG $([ "$WINDOW_MANAGER" = "kwin" ] && echo -n "kwin-x11" || echo -n $WINDOW_MANAGER) | |
[ "$WITH_TEST_POD" = "yes" ] && cpanm --quiet --notest Test::Pod || true | |
Xvfb :123 & | |
export DISPLAY=:123 | |
(sleep 10; $WINDOW_MANAGER) & | |
- name: Configure | |
run: | | |
perl Makefile.PL | |
- name: Build | |
run: | | |
make -j8 | |
- name: Test | |
env: | |
HARNESS_TIMER: 1 | |
HARNESS_OPTIONS: j8 | |
run: | | |
make test | |
if: "!startsWith(matrix.os,'windows-')" | |
test_in_container: | |
name: Test with ${{ matrix.image }} | |
runs-on: ubuntu-latest | |
container: ${{ matrix.image }} | |
strategy: | |
matrix: | |
include: | |
## Note: do not use "slim" images -> we need a C compiler | |
- image: perl:5.8.9-threaded-stretch | |
- image: perl:5.10.1-buster | |
- image: perl:5.12.5-stretch | |
- image: perl:5.14.4-stretch | |
- image: perl:5.16.3-buster | |
- image: perl:5.18.4-buster | |
- image: perl:5.22.4-stretch | |
- image: perl:5.36.0-bullseye | |
- image: perl:5.38.0-bookworm | |
## use debian:* images only if there's no suitable perl:* image | |
#- image: debian:bookworm | |
steps: | |
- uses: actions/checkout@v3 | |
- name: get debian codename | |
run: | | |
set -e | |
CODENAME=$(perl -nle '/^VERSION_CODENAME="?([^"]+)/ and $codename=$1; /^VERSION="\d+ \((.*)\)/ and $maybe_codename=$1; END { print $codename || $maybe_codename }' /etc/os-release) | |
echo "CODENAME=$CODENAME" >> $GITHUB_ENV | |
- name: apt hacks | |
run: | | |
set -e | |
case "$CODENAME" in | |
wheezy|jessie|stretch) | |
echo "APT::Get::AllowUnauthenticated 1;" > /etc/apt/apt.conf.d/02allow-unsigned | |
echo "deb [check-valid-until=no] http://archive.debian.org/debian $CODENAME main" > /etc/apt/sources.list | |
echo "deb [check-valid-until=no] http://archive.debian.org/debian-security/ $CODENAME/updates main" >> /etc/apt/sources.list | |
;; | |
esac | |
- name: apt deps | |
run: | | |
apt-get update -qq && apt-get install -qqy xvfb libx11-dev libfreetype6-dev libxft-dev libpng-dev libz-dev libjpeg-dev twm | |
case "$CODENAME" in | |
bookworm) | |
apt-get install -qqy perl | |
;; | |
esac | |
case "${{ matrix.image }}" in | |
perl*) | |
;; | |
*) | |
apt-get install -qqy gcc make | |
;; | |
esac | |
- name: build and test | |
run: | | |
Xvfb :123 & | |
export DISPLAY=:123 | |
(sleep 10; twm) & | |
perl Makefile.PL | |
make -j8 | |
HARNESS_TIMER=1 HARNESS_OPTIONS=j8 make test |