Skip to content

Commit dfde632

Browse files
tests(deploys): separate deploy test workflow from pytest workflow (#1518)
Co-authored-by: Barret Schloerke <barret@posit.co>
1 parent 83c02b7 commit dfde632

File tree

2 files changed

+54
-49
lines changed

2 files changed

+54
-49
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run deploy tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main", "rc-*", "deploy-**"]
7+
8+
jobs:
9+
playwright-deploys:
10+
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
11+
# Only one is allowed to run at a time because it is deploying to the same server location.
12+
concurrency: playwright-deploys
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
# Matches deploy server python version
17+
python-version: ["3.10"]
18+
os: [ubuntu-latest]
19+
fail-fast: false
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Setup py-shiny
24+
uses: ./.github/py-shiny/setup
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Test that deployable example apps work
29+
timeout-minutes: 5 # ~10s locally
30+
env:
31+
DEPLOY_APPS: "false"
32+
run: |
33+
make playwright-deploys SUB_FILE=". -vv"
34+
35+
- name: Deploy apps and run tests (on `push` or `deploy**` branches)
36+
env:
37+
DEPLOY_APPS: "true"
38+
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
39+
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
40+
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
41+
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
42+
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
43+
timeout-minutes: 30
44+
# Given we are waiting for external servers to finish,
45+
# we can have many local processes waiting for deployment to finish
46+
run: |
47+
make playwright-deploys SUB_FILE=". -vv --numprocesses 12"
48+
49+
- uses: actions/upload-artifact@v4
50+
if: failure()
51+
with:
52+
name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results"
53+
path: test-results/
54+
retention-days: 5

.github/workflows/pytest.yaml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -158,55 +158,6 @@ jobs:
158158
path: test-results/
159159
retention-days: 5
160160

161-
playwright-deploys:
162-
needs: [playwright-deploys-precheck]
163-
if: github.event_name != 'release' && (github.event_name == 'push' || startsWith(github.head_ref, 'deploy'))
164-
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
165-
# Only one is allowed to run at a time because it is deploying to the same server location.
166-
concurrency: playwright-deploys
167-
runs-on: ${{ matrix.os }}
168-
strategy:
169-
matrix:
170-
# Matches deploy server python version
171-
python-version: ["3.10"]
172-
os: [ubuntu-latest]
173-
fail-fast: false
174-
175-
steps:
176-
- uses: actions/checkout@v4
177-
- name: Setup py-shiny
178-
uses: ./.github/py-shiny/setup
179-
with:
180-
python-version: ${{ matrix.python-version }}
181-
182-
- name: Test that deployable example apps work
183-
timeout-minutes: 5 # ~10s locally
184-
env:
185-
DEPLOY_APPS: "false"
186-
run: |
187-
make playwright-deploys SUB_FILE=". -vv"
188-
189-
- name: Deploy apps and run tests (on `push` or `deploy**` branches)
190-
env:
191-
DEPLOY_APPS: "true"
192-
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
193-
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
194-
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
195-
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
196-
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
197-
timeout-minutes: 30
198-
# Given we are waiting for external servers to finish,
199-
# we can have many local processes waiting for deployment to finish
200-
run: |
201-
make playwright-deploys SUB_FILE=". -vv --numprocesses 12"
202-
203-
- uses: actions/upload-artifact@v4
204-
if: failure()
205-
with:
206-
name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results"
207-
path: test-results/
208-
retention-days: 5
209-
210161
pypi:
211162
name: "Deploy to PyPI"
212163
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)