@@ -51,106 +51,19 @@ jobs:
51
51
runs-on : ubuntu-latest
52
52
strategy :
53
53
matrix :
54
- python : ["3.12 "]
54
+ octoprint : ["master", "maintenance "]
55
55
steps :
56
- - name : " ⬇ Checkout OctoPrint with E2E tests"
57
- uses : actions/checkout@v4
58
- with :
59
- repository : OctoPrint/OctoPrint
60
- ref : maintenance
61
- fetch-depth : 0
62
- path : OctoPrint
63
-
64
56
- name : ⬇ Download build result
65
57
uses : actions/download-artifact@v4
66
58
with :
67
59
name : dist
68
60
path : dist
69
61
70
- - name : 🏗 Set up Python ${{ matrix.python }}
71
- uses : actions/setup-python@v5
72
- with :
73
- python-version : ${{ matrix.python }}
74
-
75
- - name : 🏗 Install OctoPrint
76
- working-directory : ./OctoPrint/
77
- run : |
78
- pip install .
79
- pip install --force-reinstall ${{ github.workspace }}/dist/*.whl
80
-
81
- - name : 🏗 Create base config for test server
82
- run : |
83
- mkdir e2econfig
84
- cp -r OctoPrint/.github/fixtures/with_acl/* e2econfig
85
-
86
- - name : 🏗 Install dummy mfa plugin if available
87
- run : |
88
- plugin="${{ github.workspace }}/OctoPrint/.github/fixtures/mfa_dummy"
89
- if [ -f "$plugin" ]; then
90
- mkdir -p e2econfig/plugins
91
- cp -r "$plugin" "e2econfig/plugins/mfa_dummy"
92
- fi
93
-
94
- - name : 🏗 Prepare Playwright env
95
- working-directory : ./OctoPrint/tests/playwright
96
- run : |
97
- npm ci
98
- PLAYWRIGHT_VERSION=$(npm ls --json @playwright/test | jq --raw-output '.dependencies["@playwright/test"].version')
99
- echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
100
-
101
- - name : 🧰 Cache Playwright browser binaries
102
- uses : actions/cache@v4
103
- id : playwright-cache
104
- with :
105
- path : " ~/.cache/ms-playwright"
106
- key : " ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
107
- restore-keys : |
108
- ${{ runner.os }}-playwright-
109
-
110
- - name : 🏗 Install Playwright browser binaries & OS dependencies
111
- if : steps.playwright-cache.outputs.cache-hit != 'true'
112
- working-directory : ./OctoPrint/tests/playwright
113
- run : |
114
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
115
- npx playwright install --with-deps
116
-
117
- - name : 🏗 Install Playwright OS dependencies
118
- if : steps.playwright-cache.outputs.cache-hit == 'true'
119
- working-directory : ./OctoPrint/tests/playwright
120
- run : |
121
- sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
122
- npx playwright install-deps
123
-
124
- - name : 🎭 Run Playwright
125
- working-directory : ./OctoPrint/tests/playwright
126
- run : |
127
- npx playwright test
128
- env :
129
- OCTOPRINT_SERVER_BASE : ${{ github.workspace }}/e2econfig
130
- TEST_MFA : true
131
-
132
- - name : 🔎 Check octoprint.log for errors
133
- run : |
134
- log=${{ github.workspace }}/e2econfig/logs/octoprint.log
135
- if grep "\- ERROR \-" $log; then
136
- echo "::error::Errors were logged to octoprint.log"
137
- grep -Pazo '(?m)^\N+\- ERROR \-\N*\n(^\N*?\n)*?(?=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \- )' $log
138
- exit 1
139
- fi
140
-
141
- - name : ⬆ Upload Playwright report
142
- uses : actions/upload-artifact@v4
143
- if : always()
144
- with :
145
- name : playwright-report-py${{ matrix.python }}
146
- path : tests/playwright/playwright-report
147
-
148
- - name : ⬆ Upload OctoPrint logs
149
- uses : actions/upload-artifact@v4
150
- if : failure()
62
+ - name : 🎭 Run OctoPrint's E2E Tests
63
+ uses : OctoPrint/actions/e2e@main
151
64
with :
152
- name : octoprint-logs-py ${{ matrix.python }}
153
- path : ${{ github.workspace }}/e2econfig/logs
65
+ ref : ${{ matrix.octoprint }}
66
+ deps : ${{ github.workspace }}/dist/*.whl
154
67
155
68
publish-on-testpypi :
156
69
name : 📦 Publish on TestPyPI
169
82
- name : 📦 Publish to index
170
83
uses : pypa/gh-action-pypi-publish@release/v1
171
84
with :
172
- repository_url : https://test.pypi.org/legacy/
85
+ repository-url : https://test.pypi.org/legacy/
173
86
174
87
publish-on-pypi :
175
88
name : 📦 Publish tagged releases to PyPI
0 commit comments