-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
180 lines (164 loc) · 6.3 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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:
# 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
- CC: g++
feature_set: max
arch: amd64
os: ubuntu-latest
DISTCHECK: true
- CC: clang
feature_set: max
arch: amd64
os: ubuntu-latest
DISTCHECK: true
# Maximal debug 64-bit arch builds
- CC: gcc
feature_set: max
arch: amd64
os: ubuntu-latest
name_extra: and DEBUG
CONF_FLAGS_EXTRA: "--enable-devel-all"
# Maximal 32-bit arch builds
- CC: gcc
feature_set: max
arch: i386
os: ubuntu-20.04
name_extra: for 32-bit arch (legacy OS)
- CC: g++
feature_set: max
arch: i386
os: ubuntu-20.04
name_extra: for 32-bit arch (legacy OS)
- CC: clang
feature_set: max
arch: i386
os: ubuntu-20.04
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 }}
# HACK (2020-11-16): github actions doesn't support YAML anchors/aliases to
# avoid repeating long config values. So instead the config values are defined
# as environment variables using a naming convention with fields that come from
# the job config. These environment variables are then referenced as regular
# environment variables via the naming convention in the "define env" step to
# define the standard environment variable used in the rest of the steps.
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
--enable-pixman --with-imlib2"
CONF_FLAGS_i386_max: "--enable-ipv6 --enable-jpeg --enable-mp3lame
--enable-opus --enable-rfxcodec --enable-painter
--disable-pixman --with-imlib2 --host=i686-linux"
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
# Note: any "variable=value" written to the $GITHUB_ENV file will be
# 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@v4
- 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
cppcheck:
name: cppcheck
runs-on: ubuntu-latest
env:
CC: gcc
# This is required to use a version of cppcheck other than that
# supplied with the operating system
CPPCHECK_VER: "2.13.0"
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
steps:
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
- name: Get operating system name and version.
id: os
run: echo "image=$ImageOS" >>$GITHUB_OUTPUT
shell: bash
- uses: actions/checkout@v4
- name: Cache cppcheck
uses: actions/cache@v4
env:
cache-name: cache-cppcheck
with:
path: ~/cppcheck.local
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh $CPPCHECK_VER
- run: ./bootstrap
- run: ./configure
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
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:
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')
- name: Get operating system name and version.
id: os
run: echo "image=$ImageOS" >>$GITHUB_OUTPUT
shell: bash
- uses: actions/checkout@v4
- name: Cache astyle
uses: actions/cache@v4
env:
cache-name: cache-astyle
with:
path: ~/astyle.local
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.ASTYLE_VER }}
- 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