-
Notifications
You must be signed in to change notification settings - Fork 1.1k
51 lines (49 loc) · 1.94 KB
/
unit-tests.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
name: unit-tests
on: [pull_request, workflow_dispatch]
jobs:
unit-tests:
runs-on: ubuntu-22.04
permissions: {}
strategy:
matrix:
startarg:
# avoid check-memory on i386, it has literally thousands of uninteresting/wrong errors
- { make: 'check-memory', cc: 'gcc', tag: 'latest' }
# with default Python bridge
- { make: 'distcheck', cc: 'clang', tag: 'latest' }
- { make: 'distcheck', cc: 'gcc', tag: 'i386' }
# with old C bridge
- { make: 'distcheck', cc: 'gcc', distcheck_flags: '--enable-old-bridge', tag: 'latest' }
# this runs static code checks, unlike distcheck
- { make: 'check', cc: 'gcc', tag: 'latest' }
- { make: 'pytest-cov', cc: 'gcc', tag: 'latest' }
fail-fast: false
timeout-minutes: 60
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# need this to also fetch tags
fetch-depth: 0
- name: Build unit test container if it changed
run: |
changes=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}..HEAD -- containers/unit-tests/)
if [ -n "${changes}" ]; then
case '${{ matrix.startarg.tag }}' in
i386) arch=i386;;
latest) arch=amd64;;
esac
containers/unit-tests/build $arch
fi
- name: Run unit-tests container
timeout-minutes: 30
# HACK: -gdwarf-4 is for clang: https://bugs.kde.org/show_bug.cgi?id=452758
run: |
containers/unit-tests/start \
--verbose \
--env=FORCE_COLOR=1 \
--env=CC='${{ matrix.startarg.cc }}' \
--env=CFLAGS='-O2 -gdwarf-4' \
--env=EXTRA_DISTCHECK_CONFIGURE_FLAGS='${{ matrix.startarg.distcheck_flags }}' \
--image-tag='${{ matrix.startarg.tag }}' \
--make '${{ matrix.startarg.make }}'