-
Notifications
You must be signed in to change notification settings - Fork 76
168 lines (150 loc) · 4.95 KB
/
Copy pathe2e-testing.yml
File metadata and controls
168 lines (150 loc) · 4.95 KB
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
name: End-to-End Testing
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
marker:
description: 'pytest marker expression (e.g. "e2e and not slow")'
required: false
default: 'e2e and not slow'
type: string
permissions:
contents: read
actions: read
pull-requests: write
concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NO_INTERACTIVE: "1"
PCILEECH_DISABLE_UPDATE_CHECK: "1"
jobs:
# Fast e2e: imports, CLI surface, donor-template, version resolution,
# overlay generation. No container, no full build, no hardware. Runs on
# every PR.
e2e-fast:
name: E2E (fast, Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools-scm needs full history for the version
submodules: recursive
- name: Python setup & install
uses: ./.github/actions/python-setup
with:
python-version: ${{ matrix.python-version }}
requirements-files: 'requirements.txt'
extras: 'tui,test'
editable: 'true'
- name: Run e2e tests
run: |
MARKERS="${{ github.event.inputs.marker || 'e2e and not slow and not requires_container_runtime and not requires_build_isolation' }}"
python -m pytest tests/e2e/ \
-m "$MARKERS" \
--tb=short \
--strict-markers \
--no-cov \
--junit-xml=junit-e2e-fast.xml
- name: Upload junit
uses: actions/upload-artifact@v7
if: always()
with:
name: e2e-fast-junit-py${{ matrix.python-version }}
path: junit-e2e-fast.xml
retention-days: 7
# Build-isolation e2e: builds an sdist + wheel and installs them into a
# fresh venv. Slower; runs on every PR but only on Python 3.11.
e2e-build:
name: E2E (build artifact)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
- name: Python setup & install
uses: ./.github/actions/python-setup
with:
python-version: '3.11'
requirements-files: 'requirements.txt'
extras: 'tui,test'
extra-packages: 'build'
editable: 'true'
- name: Run build-artifact tests
run: |
python -m pytest tests/e2e/ \
-m "e2e and requires_build_isolation" \
--tb=short \
--strict-markers \
--no-cov
# Container build e2e: runs the Containerfile through `podman build
# --target build`. Slowest job (~3-5 min cold); runs on PRs and tags.
e2e-container:
name: E2E (container build)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
- name: Install podman
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends podman
- name: Python setup & install
uses: ./.github/actions/python-setup
with:
python-version: '3.11'
requirements-files: 'requirements.txt'
extras: 'tui,test'
editable: 'true'
- name: Run container build tests
run: |
python -m pytest tests/e2e/ \
-m "e2e and requires_container_runtime" \
--tb=short \
--strict-markers \
--no-cov
# Aggregate status job for branch protection. Marks the workflow green
# only when every required job passed.
e2e-summary:
name: E2E Summary
runs-on: ubuntu-latest
needs: [e2e-fast, e2e-build, e2e-container]
if: always()
steps:
- name: Check status
run: |
status_fast='${{ needs.e2e-fast.result }}'
status_build='${{ needs.e2e-build.result }}'
status_container='${{ needs.e2e-container.result }}'
echo "## E2E Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Suite | Result |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Fast | $status_fast |" >> $GITHUB_STEP_SUMMARY
echo "| Build artifact | $status_build |" >> $GITHUB_STEP_SUMMARY
echo "| Container | $status_container |" >> $GITHUB_STEP_SUMMARY
if [[ "$status_fast" != "success" \
|| "$status_build" != "success" \
|| "$status_container" != "success" ]]; then
echo "::error::One or more E2E suites failed"
exit 1
fi
echo "All E2E suites passed."