-
Notifications
You must be signed in to change notification settings - Fork 27
210 lines (197 loc) · 5.98 KB
/
main.yml
File metadata and controls
210 lines (197 loc) · 5.98 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: main
on:
push:
branches: [main]
tags: ['*']
schedule:
- cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
test-python-versions:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
include:
- os: macos-latest
python-version: '3.13'
- os: windows-latest
python-version: '3.13'
runs-on: ${{ matrix.os }}
name: test (py${{ matrix.python-version }} ${{ matrix.os }})
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- run: pip install '.[test]'
- run: pip freeze
- run: make lint
- run: rsconnect version
- run: make test-${{ matrix.python-version }}
- if: github.event_name == 'pull_request' && matrix.python-version == '3.8'
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
prerelease-test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v6
with:
python-version: 3.8.x
- run: pip install --pre '.[test]'
- run: pip freeze
- run: make lint
- run: rsconnect version
- run: make test-3.8
distributions:
needs: test-python-versions
strategy:
matrix:
package_name: ["rsconnect_python", "rsconnect"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v6
with:
python-version: 3.8.x
- name: Install uv # see scripts/temporary-rename
uses: astral-sh/setup-uv@v6
- run: pip install -e '.[test]'
- run: pip freeze
- run: make dist
id: create_dist
env:
PACKAGE_NAME: ${{ matrix.package_name }}
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: rsconnect version
- run: rsconnect --help
- name: create github release
uses: softprops/action-gh-release@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.package_name == 'rsconnect_python'
with:
files: |
dist/*.whl
token: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
docs:
needs: test-python-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: 3.12
- name: build docs
run: make docs
- uses: actions/upload-artifact@v5
with:
name: docs
path: site/
- uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: make sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.DOCS_AWS_ROLE }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: make promote-docs-in-s3
test-connect-versions:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "preview" # nightly pre-release build of Connect
- "release" # special value that always points to the latest Connect release
- "2025.09.0" # jammy
- "2025.03.0" # jammy
- "2024.09.0" # jammy
- "2024.03.0" # jammy
- "2023.09.0" # jammy
- "2023.03.0" # bionic
- "2022.10.0" # bionic
name: Integration tests against Connect ${{ matrix.version }}
env:
python-version: 3.13
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
run: pip install '.[test]'
- run: pip freeze
- run: rsconnect version
- name: Run integration tests
uses: posit-dev/with-connect@main
with:
version: ${{ matrix.version }}
# License file valid until 2026-12-05
license: ${{ secrets.CONNECT_LICENSE_FILE }}
command: |
make test-${{ env.python-version }}
test-dev-connect:
name: "Integration tests against dev Connect"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 3.12.4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r vetiver-testing/vetiver-requirements.txt
python -m pip install '.[test]'
- name: Run Posit Connect
run: |
docker compose up --build -d
pip freeze > requirements.txt
make dev
env:
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Get logs in case of failure
run: |
docker compose logs rsconnect
if: ${{ failure() }}
# NOTE: edited to run checks for python package
- name: Run tests
run: |
pytest tests/test_main_system_caches.py
pytest -m 'vetiver'