@@ -51,106 +51,19 @@ jobs:
5151 runs-on : ubuntu-latest
5252 strategy :
5353 matrix :
54- python : ["3.12 "]
54+ octoprint : ["master", "maintenance "]
5555 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-
6456 - name : ⬇ Download build result
6557 uses : actions/download-artifact@v4
6658 with :
6759 name : dist
6860 path : dist
6961
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
15164 with :
152- name : octoprint-logs-py ${{ matrix.python }}
153- path : ${{ github.workspace }}/e2econfig/logs
65+ ref : ${{ matrix.octoprint }}
66+ deps : ${{ github.workspace }}/dist/*.whl
15467
15568 publish-on-testpypi :
15669 name : 📦 Publish on TestPyPI
16982 - name : 📦 Publish to index
17083 uses : pypa/gh-action-pypi-publish@release/v1
17184 with :
172- repository_url : https://test.pypi.org/legacy/
85+ repository-url : https://test.pypi.org/legacy/
17386
17487 publish-on-pypi :
17588 name : 📦 Publish tagged releases to PyPI
0 commit comments