-
-
Notifications
You must be signed in to change notification settings - Fork 194
86 lines (73 loc) · 2.53 KB
/
build-and-test.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
env:
TESTS_TIMEOUT: 10 # in minutes
on:
workflow_call:
inputs:
image:
required: true
type: string
image_options:
required: true
type: string
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
compiler: ['gcc', 'clang']
sanitizer: ['address']
container:
image: ${{ inputs.image }}
env:
CFLAGS: -Wp,-D_FORTIFY_SOURCE=2
CC: ${{ matrix.compiler }}
TEST_IN_CI: 1
G_MESSAGES_DEBUG: all
options: ${{ inputs.image_options }}
steps:
- name: Configure environment
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
echo XDG_DATA_DIRS=$GITHUB_WORKSPACE/tests/share:/usr/local/share:/usr/share | tee -a $GITHUB_ENV
- name: Check out xdg-desktop-portal
uses: actions/checkout@v4
- name: Run pre-commit hooks
run: |
export PYTHONPATH="/root/.local/lib/python$(python3 -c 'import sys; print("{}.{}".format(*sys.version_info))')/site-packages:$PYTHONPATH"
export PATH="/root/.local/bin:$PATH"
pre-commit run --show-diff-on-failure --color=always --all-files
- name: Check POTFILES.in
run: .github/workflows/check-potfiles.sh
- name: Build xdg-desktop-portal
run: |
meson setup _build \
-Dinstalled-tests=true \
-Dpytest=enabled \
-Db_sanitize=${{ matrix.sanitizer }} \
-Db_lundef=false \
-Dforce_fallback_for=libportal
meson compile -C _build
- name: Run xdg-desktop-portal tests
run: timeout --signal=KILL -v ${TESTS_TIMEOUT}m meson test -C _build
- name: Install xdg-desktop-portal
run: meson install -C _build
- name: Run xdg-desktop-portal installed-tests
run: |
test -n "$(gnome-desktop-testing-runner -l xdg-desktop-portal)"
gnome-desktop-testing-runner --report-directory installed-test-logs/ \
-t $((TESTS_TIMEOUT * 60)) xdg-desktop-portal
- name: Create dist tarball
run: |
ls -la
timeout --signal=KILL -v ${TESTS_TIMEOUT}m meson dist -C _build
- name: Upload test logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test logs (${{ matrix.compiler }}, ${{ matrix.sanitizer }})
path: |
tests/*.log
test-*.log
installed-test-logs/
_build/meson-logs/testlog.txt