Skip to content

Commit 3884614

Browse files
authored
Merge branch 'main' into express-modules
2 parents 0b544d4 + 03a0e40 commit 3884614

File tree

253 files changed

+10403
-2657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+10403
-2657
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Custom merge queue browsers'
2+
description: 'Trim down pytest browsers for any github event other than merge_group.'
3+
inputs:
4+
all-browsers:
5+
description: 'Force all pytest browsers to used when testing'
6+
required: false
7+
default: 'false'
8+
outputs:
9+
browsers:
10+
description: 'pytest browsers to use'
11+
value: ${{ steps.browsers.outputs.browsers }}
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Determine browsers to use
16+
shell: bash
17+
id: browsers
18+
run: |
19+
if [ "${{ inputs.all-browsers }}" == "true" ]; then
20+
echo "Using all browsers!"
21+
exit 0
22+
fi
23+
24+
if [ "${{ github.event_name }}" == "pull_request" ]; then
25+
echo "Using chrome browser only!"
26+
echo 'browsers=PYTEST_BROWSERS="--browser chromium"' >> "$GITHUB_OUTPUT"
27+
fi
28+
29+
echo "No custom pytest browsers!"
30+
exit 0

.github/workflows/build-docs.yaml

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1-
name: Build API docs
1+
name: Build API docs and Shinylive for GitHub Pages
22

33
on:
44
workflow_dispatch:
55
push:
66
branches: ["main"]
77
pull_request:
8+
merge_group:
89

910
jobs:
10-
build:
11+
build-docs:
1112
runs-on: ubuntu-latest
1213
strategy:
1314
matrix:
1415
python-version: ["3.12"]
1516
fail-fast: false
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920

2021
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2223
with:
2324
python-version: ${{ matrix.python-version }}
2425

2526
- name: Upgrade pip
2627
run: python -m pip install --upgrade pip
2728

29+
# =====================================================
30+
# API docs
31+
# =====================================================
2832
- name: Install Quarto
2933
uses: quarto-dev/quarto-actions/setup@v2
3034
with:
31-
version: 1.3.340
35+
version: 1.4.549
3236

3337
- name: Install dependencies
3438
run: |
@@ -42,25 +46,60 @@ jobs:
4246
make quartodoc
4347
4448
- name: Build site
49+
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'merge_group' || startsWith(github.head_ref, 'docs') }}
4550
run: |
4651
cd docs
4752
make site
4853
54+
# =====================================================
55+
# Shinylive
56+
# =====================================================
57+
- name: Check out shinylive
58+
if: github.ref == 'refs/heads/main'
59+
uses: actions/checkout@v4
60+
with:
61+
repository: rstudio/shinylive
62+
ref: main
63+
path: shinylive-repo
64+
65+
- name: Update shinylive's copy of shiny, htmltools, and other packages
66+
if: github.ref == 'refs/heads/main'
67+
run: |
68+
cd shinylive-repo
69+
make submodules
70+
make submodules-pull
71+
72+
- name: Build shinylive
73+
if: github.ref == 'refs/heads/main'
74+
run: |
75+
cd shinylive-repo
76+
make all
77+
78+
# =====================================================
79+
# Deploy
80+
# =====================================================
81+
82+
- name: Move built API docs and shinylive to single directory
83+
if: github.ref == 'refs/heads/main'
84+
run: |
85+
mkdir deploy
86+
mv docs/_site deploy/docs
87+
mv shinylive-repo/_shinylive deploy/shinylive
88+
4989
- name: Upload site artifact
5090
if: github.ref == 'refs/heads/main'
5191
uses: actions/upload-pages-artifact@v1
5292
with:
53-
path: "docs/_site"
54-
93+
path: "deploy"
5594

5695
deploy:
5796
if: github.ref == 'refs/heads/main'
58-
needs: build
97+
needs: build-docs
5998

6099
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
61100
permissions:
62-
pages: write # to deploy to Pages
63-
id-token: write # to verify the deployment originates from an appropriate source
101+
pages: write # to deploy to Pages
102+
id-token: write # to verify the deployment originates from an appropriate source
64103

65104
# Deploy to the github-pages environment
66105
environment:

.github/workflows/pytest.yaml

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
push:
66
branches: ["main", "rc-*"]
77
pull_request:
8+
merge_group:
89
release:
910
types: [published]
1011
schedule:
1112
- cron: "0 8 * * *"
1213

1314
jobs:
14-
build:
15+
check:
1516
runs-on: ubuntu-latest
1617
strategy:
1718
matrix:
@@ -21,7 +22,7 @@ jobs:
2122
fail-fast: false
2223

2324
steps:
24-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2526
- name: Setup py-shiny
2627
id: install
2728
uses: ./.github/py-shiny/setup
@@ -33,25 +34,20 @@ jobs:
3334
run: |
3435
make check-tests
3536
36-
- name: Type check with pyright
37+
- name: Type check
3738
if: steps.install.outcome == 'success' && (success() || failure())
3839
run: |
3940
make check-types
4041
41-
- name: Lint with flake8
42+
- name: Lint code
4243
if: steps.install.outcome == 'success' && (success() || failure())
4344
run: |
4445
make check-lint
4546
46-
- name: black
47+
- name: Verify code formatting
4748
if: steps.install.outcome == 'success' && (success() || failure())
4849
run: |
49-
make check-black
50-
51-
- name: isort
52-
if: steps.install.outcome == 'success' && (success() || failure())
53-
run: |
54-
make check-isort
50+
make check-format
5551
5652
playwright-shiny:
5753
runs-on: ${{ matrix.os }}
@@ -63,16 +59,24 @@ jobs:
6359
fail-fast: false
6460

6561
steps:
66-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
6763
- name: Setup py-shiny
6864
uses: ./.github/py-shiny/setup
6965
with:
7066
python-version: ${{ matrix.python-version }}
7167

68+
- name: Determine browsers for testing
69+
uses: ./.github/py-shiny/pytest-browsers
70+
id: browsers
71+
with:
72+
all-browsers: ${{ startsWith(github.head_ref, 'playwright') }}
73+
- name: Display browser
74+
shell: bash
75+
run: echo '${{ steps.browsers.outputs.browsers }}'
7276
- name: Run End-to-End tests
7377
timeout-minutes: 20
7478
run: |
75-
make playwright-shiny SUB_FILE=". -vv"
79+
make playwright-shiny SUB_FILE=". -vv" ${{ steps.browsers.outputs.browsers }}
7680
- uses: actions/upload-artifact@v4
7781
if: failure()
7882
with:
@@ -90,14 +94,14 @@ jobs:
9094
fail-fast: false
9195

9296
steps:
93-
- uses: actions/checkout@v3
97+
- uses: actions/checkout@v4
9498
- name: Setup py-shiny
9599
uses: ./.github/py-shiny/setup
96100
with:
97101
python-version: ${{ matrix.python-version }}
98102

99103
- name: Install node.js
100-
uses: actions/setup-node@v3
104+
uses: actions/setup-node@v4
101105
with:
102106
node-version: "18"
103107
cache: npm
@@ -107,10 +111,15 @@ jobs:
107111
run: |
108112
npm ci
109113
114+
- name: Determine browsers for testing
115+
uses: ./.github/py-shiny/pytest-browsers
116+
id: browsers
117+
with:
118+
all-browsers: ${{ startsWith(github.head_ref, 'playwright') }}
110119
- name: Run example app tests
111120
timeout-minutes: 20
112121
run: |
113-
make playwright-examples SUB_FILE=". -vv"
122+
make playwright-examples SUB_FILE=". -vv" ${{ steps.browsers.outputs.browsers }}
114123
- uses: actions/upload-artifact@v4
115124
if: failure()
116125
with:
@@ -129,7 +138,7 @@ jobs:
129138
fail-fast: false
130139

131140
steps:
132-
- uses: actions/checkout@v3
141+
- uses: actions/checkout@v4
133142
- name: Setup py-shiny
134143
uses: ./.github/py-shiny/setup
135144
with:
@@ -142,9 +151,16 @@ jobs:
142151
run: |
143152
make playwright-deploys SUB_FILE=". -vv"
144153
154+
- uses: actions/upload-artifact@v4
155+
if: failure()
156+
with:
157+
name: "playright-examples-${{ matrix.os }}-${{ matrix.python-version }}-results"
158+
path: test-results/
159+
retention-days: 5
160+
145161
playwright-deploys:
146162
needs: [playwright-deploys-precheck]
147-
if: github.event_name != 'release' && (github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')))
163+
if: github.event_name != 'release' && (github.event_name == 'push' || startsWith(github.head_ref, 'deploy'))
148164
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
149165
# Only one is allowed to run at a time because it is deploying to the same server location.
150166
concurrency: playwright-deploys
@@ -157,7 +173,7 @@ jobs:
157173
fail-fast: false
158174

159175
steps:
160-
- uses: actions/checkout@v3
176+
- uses: actions/checkout@v4
161177
- name: Setup py-shiny
162178
uses: ./.github/py-shiny/setup
163179
with:
@@ -170,8 +186,7 @@ jobs:
170186
run: |
171187
make playwright-deploys SUB_FILE=". -vv"
172188
173-
- name: Deploy apps and run tests (on `push` or on `pull_request` w/ `deploy**` branch)
174-
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')) }}
189+
- name: Deploy apps and run tests (on `push` or `deploy**` branches)
175190
env:
176191
DEPLOY_APPS: "true"
177192
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
@@ -196,9 +211,9 @@ jobs:
196211
name: "Deploy to PyPI"
197212
runs-on: ubuntu-latest
198213
if: github.event_name == 'release'
199-
needs: [build]
214+
needs: [check]
200215
steps:
201-
- uses: actions/checkout@v3
216+
- uses: actions/checkout@v4
202217
- name: "Set up Python 3.10"
203218
uses: actions/setup-python@v4
204219
with:
@@ -232,7 +247,7 @@ jobs:
232247

233248
testrail-reporting-nightly:
234249
runs-on: ${{ matrix.os }}
235-
if: ${{ github.event_name == 'schedule' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'testrail')) }}
250+
if: ${{ github.event_name == 'schedule' || startsWith(github.head_ref, 'testrail') }}
236251
strategy:
237252
matrix:
238253
python-version:
@@ -245,14 +260,14 @@ jobs:
245260
fail-fast: false
246261

247262
steps:
248-
- uses: actions/checkout@v3
263+
- uses: actions/checkout@v4
249264
- name: Setup py-shiny
250265
uses: ./.github/py-shiny/setup
251266
with:
252267
python-version: ${{ matrix.python-version }}
253268

254269
- name: Install node.js
255-
uses: actions/setup-node@v3
270+
uses: actions/setup-node@v4
256271
with:
257272
node-version: "18"
258273
cache: npm

.github/workflows/verify-js-built.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Build
1+
name: Verify built assets
22

33
on:
44
push:
55
branches: ["main", "rc-*"]
66
pull_request:
7+
merge_group:
78

89
jobs:
910
verify_js_built:

.prettierrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"organizeImportsSkipDestructiveCodeActions": true
2+
"organizeImportsSkipDestructiveCodeActions": true,
3+
"overrides": [
4+
{
5+
"files": "**/*.scss",
6+
"options": {
7+
"printWidth": 150
8+
}
9+
}
10+
]
311
}

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"posit.shiny-python",
4+
"esbenp.prettier-vscode",
5+
"ms-python.black-formatter",
6+
]
7+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"editor.formatOnSave": true,
2525
"editor.defaultFormatter": "esbenp.prettier-vscode"
2626
},
27+
"[scss]": {
28+
"editor.formatOnSave": true,
29+
"editor.defaultFormatter": "esbenp.prettier-vscode"
30+
},
2731
"[python]": {
2832
"editor.defaultFormatter": "ms-python.black-formatter",
2933
"editor.formatOnSave": true,

0 commit comments

Comments
 (0)