2020-11-17 08:49:39 +03:00
|
|
|
name: build and test
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- "gh-pages"
|
|
|
|
tags-ignore:
|
|
|
|
- "v0.[0-8]**"
|
|
|
|
pull_request:
|
|
|
|
branches-ignore:
|
|
|
|
- "gh-pages"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
# Minimal 64-bit arch builds
|
|
|
|
- CC: gcc
|
|
|
|
feature_set: min
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
|
|
|
|
- CC: g++
|
|
|
|
feature_set: min
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
|
|
|
|
- CC: clang
|
|
|
|
feature_set: min
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
|
|
|
|
# Maximal 64-bit arch builds
|
|
|
|
- CC: gcc
|
|
|
|
feature_set: max
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
DISTCHECK: true
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
- CC: g++
|
|
|
|
feature_set: max
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
DISTCHECK: true
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
- CC: clang
|
|
|
|
feature_set: max
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
DISTCHECK: true
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
# Maximal debug 64-bit arch builds
|
2022-05-10 14:12:14 +03:00
|
|
|
# Check we can also do a static build without
|
|
|
|
# installing .a files
|
2020-11-17 08:49:39 +03:00
|
|
|
- CC: gcc
|
|
|
|
feature_set: max
|
|
|
|
arch: amd64
|
|
|
|
os: ubuntu-latest
|
|
|
|
name_extra: and DEBUG
|
2022-05-10 14:12:14 +03:00
|
|
|
CONF_FLAGS_EXTRA: "--enable-devel-all --disable-static"
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
# Maximal 32-bit arch builds
|
|
|
|
- CC: gcc
|
|
|
|
feature_set: max
|
|
|
|
arch: i386
|
2021-06-07 18:09:48 +03:00
|
|
|
os: ubuntu-18.04
|
2020-11-17 08:49:39 +03:00
|
|
|
name_extra: for 32-bit arch (legacy OS)
|
|
|
|
|
|
|
|
- CC: g++
|
|
|
|
feature_set: max
|
|
|
|
arch: i386
|
2021-06-07 18:09:48 +03:00
|
|
|
os: ubuntu-18.04
|
2020-11-17 08:49:39 +03:00
|
|
|
name_extra: for 32-bit arch (legacy OS)
|
|
|
|
|
|
|
|
- CC: clang
|
|
|
|
feature_set: max
|
|
|
|
arch: i386
|
2021-06-07 18:09:48 +03:00
|
|
|
os: ubuntu-18.04
|
2020-11-17 08:49:39 +03:00
|
|
|
name_extra: for 32-bit arch (legacy OS)
|
|
|
|
|
|
|
|
name: ${{ matrix.feature_set }} features with ${{ matrix.CC }} ${{ matrix.name_extra }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.CC }}
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2022-09-03 02:48:01 +03:00
|
|
|
# HACK (2020-11-16): github actions doesn't support YAML anchors/aliases to
|
2021-03-04 15:09:18 +03:00
|
|
|
# avoid repeating long config values. So instead the config values are defined
|
|
|
|
# as environment variables using a naming convention with fields that come from
|
2022-09-03 02:48:01 +03:00
|
|
|
# the job config. These environment variables are then referenced as regular
|
2021-03-04 15:09:18 +03:00
|
|
|
# environment variables via the naming convention in the "define env" step to
|
2022-09-03 02:48:01 +03:00
|
|
|
# define the standard environment variable used in the rest of the steps.
|
2020-11-17 08:49:39 +03:00
|
|
|
CONF_FLAGS_amd64_min: "--disable-ipv6 --disable-jpeg --disable-fuse --disable-mp3lame
|
|
|
|
--disable-fdkaac --disable-opus --disable-rfxcodec --disable-painter
|
|
|
|
--disable-pixman"
|
|
|
|
CONF_FLAGS_amd64_max: "--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame
|
|
|
|
--enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter
|
2022-09-06 11:58:04 +03:00
|
|
|
--enable-pixman --with-imlib2 --with-freetype2"
|
2020-11-17 08:49:39 +03:00
|
|
|
CONF_FLAGS_i386_max: "--enable-ipv6 --enable-jpeg --enable-fuse --enable-mp3lame
|
|
|
|
--enable-fdkaac --enable-opus --enable-rfxcodec --enable-painter
|
2022-09-06 11:58:04 +03:00
|
|
|
--disable-pixman --with-imlib2 --with-freetype2
|
|
|
|
--host=i686-linux"
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
PKG_CONFIG_PATH_i386: "/usr/lib/i386-linux-gnu/pkgconfig"
|
|
|
|
CFLAGS_i386: "-m32"
|
|
|
|
LDFLAGS_i386: "-m32"
|
|
|
|
steps:
|
|
|
|
- name: Define feature and arch dependent environment variables
|
2021-03-04 15:09:18 +03:00
|
|
|
# Note: any "variable=value" written to the $GITHUB_ENV file will be
|
2020-11-17 08:49:39 +03:00
|
|
|
# defined as an environment variable for all future steps in this job
|
|
|
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
|
|
|
run: |
|
|
|
|
echo "CONF_FLAGS=$CONF_FLAGS_${{ matrix.arch }}_${{ matrix.feature_set }} ${{ matrix.CONF_FLAGS_EXTRA }}" >> $GITHUB_ENV
|
|
|
|
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH_${{ matrix.arch }}" >> $GITHUB_ENV
|
|
|
|
echo "CFLAGS=$CFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV
|
|
|
|
echo "LDFLAGS=$LDFLAGS_${{ matrix.arch }}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: sudo scripts/install_xrdp_build_dependencies_with_apt.sh ${{ matrix.feature_set }} ${{ matrix.arch }} --allow-downgrades --allow-remove-essential --allow-change-held-packages
|
|
|
|
- run: ./bootstrap
|
|
|
|
- run: ./configure $CONF_FLAGS
|
|
|
|
- run: make
|
|
|
|
- if: ${{ matrix.DISTCHECK }}
|
|
|
|
run: make distcheck
|
2021-03-04 15:09:18 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
cppcheck:
|
|
|
|
name: cppcheck
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
CC: gcc
|
|
|
|
# This is required to use a version of cppcheck other than that
|
2020-12-24 12:44:28 +03:00
|
|
|
# supplied with the operating system
|
2022-08-30 12:39:49 +03:00
|
|
|
CPPCHECK_VER: 2.9
|
2020-11-17 08:49:39 +03:00
|
|
|
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
|
|
|
|
steps:
|
2022-05-25 13:04:07 +03:00
|
|
|
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
|
|
|
|
# see https://github.com/actions/cache/issues/543
|
|
|
|
- name: Get operating system name and version.
|
|
|
|
id: os
|
|
|
|
run: echo "::set-output name=image::$ImageOS"
|
|
|
|
shell: bash
|
2020-11-17 08:49:39 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-11-23 08:36:06 +03:00
|
|
|
- name: Cache cppcheck
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-cppcheck
|
|
|
|
with:
|
|
|
|
path: ~/cppcheck.local
|
2022-05-25 13:04:07 +03:00
|
|
|
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
|
2020-11-17 08:49:39 +03:00
|
|
|
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh
|
|
|
|
- run: ./bootstrap
|
|
|
|
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
|
|
|
|
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
|
2021-05-08 19:53:32 +03:00
|
|
|
|
|
|
|
code_formatting_check:
|
|
|
|
name: code formatting check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
CC: gcc
|
|
|
|
# This is required to use a version of astyle other than that
|
|
|
|
# supplied with the operating system
|
|
|
|
ASTYLE_VER: 3.1
|
|
|
|
ASTYLE_REPO: https://svn.code.sf.net/p/astyle/code/tags
|
|
|
|
steps:
|
2022-05-27 13:48:16 +03:00
|
|
|
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
|
|
|
|
# see https://github.com/actions/cache/issues/543
|
|
|
|
- name: Get operating system name and version.
|
|
|
|
id: os
|
|
|
|
run: echo "::set-output name=image::$ImageOS"
|
|
|
|
shell: bash
|
2021-05-08 19:53:32 +03:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache astyle
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-astyle
|
|
|
|
with:
|
|
|
|
path: ~/astyle.local
|
2022-05-27 13:48:16 +03:00
|
|
|
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }}
|
2021-05-08 19:53:32 +03:00
|
|
|
- run: sudo scripts/install_astyle_dependencies_with_apt.sh
|
|
|
|
- run: scripts/install_astyle.sh $ASTYLE_REPO $ASTYLE_VER
|
|
|
|
- name: Format code with astyle
|
|
|
|
run: scripts/run_astyle.sh
|
|
|
|
- name: Check code formatting
|
|
|
|
run: git diff --exit-code
|