-
Notifications
You must be signed in to change notification settings - Fork 1
171 lines (141 loc) · 4.95 KB
/
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
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
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }}
cancel-in-progress: true
on:
merge_group:
types: [checks_requested]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/test*yml
- mir-ci/**
jobs:
RunTests:
strategy:
fail-fast: false
matrix:
server:
- mir_kiosk
- ubuntu_frame
- mir_test_tools
channel: [stable]
variant: [noble/1024/1024x768]
include:
- server: ubuntu_frame
channel: 24/edge
- server: mir_test_tools
channel: 22/stable
variant: 22/noble/1024/1024x768
- server: mir_test_tools
channel: 24/edge
- server: mir_demo_server
channel: null
- server: mir_demo_server
channel: null
ppa: mir-team/dev
- server: confined_shell
channel: beta
- server: confined_shell
channel: edge
- server: gnome_shell
channel: null
- server: null
channel: null
mark: self
runs-on: ubuntu-24.04
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v4
with:
lfs: true
- id: vars
name: Determine variables
run: |
PYTEST_ARGS=( --verbose --capture=no )
[ -n '${{ matrix.server }}' ] && PYTEST_ARGS+=( -k ${{ matrix.server }} )
[ -n '${{ matrix.mark }}' ] && PYTEST_ARGS+=( -m ${{ matrix.mark }} )
[ '${{ matrix.mark }}' == 'self' ] && PYTEST_ARGS+=( --cov --cov-branch --cov-report=xml )
echo pytest_args=${PYTEST_ARGS[@]} >> $GITHUB_OUTPUT
ARTIFACT_KEY="${{ matrix.server || matrix.mark }}"
[ -n '${{ matrix.channel }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.channel }} | tr / _ )"
[ -n '${{ matrix.ppa }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.ppa }} | tr / _ )"
echo artifact_key=${ARTIFACT_KEY} >> $GITHUB_OUTPUT
- name: Set up dependencies
working-directory: mir-ci/mir_ci
run: |
[ -n '${{ matrix.ppa }}' ] && sudo add-apt-repository --yes ppa:${{ matrix.ppa }}
SNAP=$( echo ${{ matrix.server }} | tr _ - )
[ -n '${{ matrix.channel }}' ] && sudo snap install ${SNAP} --channel ${{ matrix.channel }}
[ -x /snap/${SNAP}/current/bin/setup.sh ] && /snap/${SNAP}/current/bin/setup.sh
sudo apt-get --yes install pkg-config libwayland-dev ffmpeg
pip install -e ..
[ '${{ matrix.mark }}' == 'self' ] && pip install pytest-cov
python -m pytest ${{ steps.vars.outputs.pytest_args }} --deps
- name: Run the tests
working-directory: mir-ci/mir_ci
env:
MIR_CI_VARIANT: ${{ matrix.variant }}
run: |
# set up coredumps
ulimit -c unlimited
echo "/tmp/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern
sudo systemd-run --uid 1001 -p Environment=XDG_SESSION_TYPE=wayland -p PAMName=login -p TTYPath=/dev/tty1 -- tail -f /dev/null
python -m pytest ${{ steps.vars.outputs.pytest_args }} --junitxml=junit-${{ matrix.server || matrix.mark }}-${{ matrix.python }}.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ steps.vars.outputs.artifact_key }}
path: |
mir-ci/mir_ci/junit-*.xml
/tmp/pytest-of-*/*-current/**/log.html
- if: ${{ matrix.mark == 'self' }}
name: Upload coverage data
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: mir-ci/mir_ci
fail_ci_if_error: true
verbose: true
- if: ${{ failure() }}
name: Collect any core dumps
run: |
sudo find /tmp/ -name corefile-* -exec chown $UID {} \; -exec mv -v {} . \;
- if: ${{ failure() }}
name: Upload any core dumps
uses: actions/upload-artifact@v4
with:
name: core-dumps-${{ steps.vars.outputs.artifact_key }}
path: corefile-*
if-no-files-found: ignore
- if: ${{ failure() && runner.debug }}
name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
ProcessArtifacts:
runs-on: ubuntu-24.04
needs: RunTests
if: ${{ success() || failure() }}
steps:
- uses: actions/checkout@v4
- name: Merge junit reports
uses: actions/upload-artifact/merge@v4
with:
name: test-results
pattern: test-results-*
separate-directories: true
delete-merged: true
- name: Download the test results
uses: actions/download-artifact@v4
with:
name: test-results
- name: Report test results
uses: dorny/test-reporter@v1
with:
name: "Test results"
path: '**/junit-*.xml'
reporter: java-junit