-
-
Notifications
You must be signed in to change notification settings - Fork 309
165 lines (144 loc) · 5.43 KB
/
ubuntu.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
---
name: Ubuntu
# Build and run tests on Ubuntu
on:
push:
branches:
- main
- releasebranch_*
pull_request:
jobs:
ubuntu:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.name }}-${{ matrix.os }}-${{ matrix.extra-include }}
cancel-in-progress: true
runs-on: ${{ matrix.os }}
env:
PYTHONWARNINGS: always
strategy:
matrix:
name:
- "22.04"
- minimum config
# Only run tests for these folders in this matrix job.
extra-include:
# All root folders that could contain tests are:
# db display doc docker general gui
# imagery lib misc ps python raster raster3d scripts
# temporal testsuite utils vector visualization
#
# In order to split test executions, all these root folders are
# added as excluded folders, then items included for this matrix
# job are removed from that exclusion list.
#
# Using folded YAML multiline string block chomping (>-) to replace
# newlines with spaces, and strip newline at end.
# See https://yaml-multiline.info/
- temporal
- >-
db display doc docker general gui
imagery lib misc ps python raster raster3d scripts
testsuite utils vector visualization
include:
- name: "22.04"
os: ubuntu-22.04
config: ubuntu-22.04
# This is without optional things but it still keeps things useful,
# so, e.g., without OpenMP, but with PDAL. Code or tests should be written
# so that test pass even when these optional things are not present.
- name: minimum config
os: ubuntu-22.04
config: ubuntu-22.04_without_x
fail-fast: false
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Invert inclusion list to an exclusion list
id: get-exclude
run: |
array=(db display doc docker general gui \
imagery lib misc ps python raster raster3d scripts \
temporal testsuite utils vector visualization)
echo "Complete set of folders that can be included:"
echo "${array[@]}"
delete=( ${{ env.DELETE_ARRAY }} )
echo "Included folders to remove from the complete set:"
echo "${delete[@]}"
for target in "${delete[@]}"; do
for i in "${!array[@]}"; do
if [[ ${array[i]} = $target ]]; then
unset 'array[i]'
fi
done
done
unset new_array
for i in "${!array[@]}"; do
new_array+=( "${array[i]}" )
done
echo "Excluded folders:"
echo "${new_array[@]}"
printf -v extra_exclude './%s/* ' "${new_array[@]}"
echo "Exclusion string to add to gunittest config"
echo "${extra_exclude}"
echo "extra-exclude=${extra_exclude}" >> "${GITHUB_OUTPUT}"
env:
DELETE_ARRAY: ${{ matrix.extra-include }}
- name: Add extra exclusions to a gunittest config file
run: |
sed 's:exclude =:exclude = ${{
steps.get-exclude.outputs.extra-exclude
}}:g' .gunittest.cfg > .gunittest.extra.cfg
cat .gunittest.extra.cfg
- name: Get dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Create installation directory
run: |
mkdir $HOME/install
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH for compilation
run: |
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
- name: Print build environment variables
shell: bash -el {0}
run: |
printenv | sort
gcc --version
ldd --version
- name: Build
env:
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
CFLAGS: -fPIC -Wvla
# TODO: -pedantic-errors here won't compile
CXXFLAGS: -fPIC
run: .github/workflows/build_${{ matrix.config }}.sh $HOME/install -Werror
- name: Add the bin directory to PATH
run: |
echo "$HOME/install/bin" >> $GITHUB_PATH
- name: Print installed versions
if: always()
run: .github/workflows/print_versions.sh
- name: Test executing of the grass command
run: .github/workflows/test_simple.sh
- name: Run tests
run: .github/workflows/test_thorough.sh --config .gunittest.extra.cfg
- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testreport-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.extra-include }}
path: testreport
retention-days: 3
build-and-test-success:
name: Build & Test Result
needs:
- ubuntu
if: ${{ always() }}
uses: ./.github/workflows/verify-success.yml
with:
needs_context: ${{ toJson(needs) }}