This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
146 lines (145 loc) · 4.58 KB
/
main.yml
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
name: main
on:
push:
branches: [master]
tags: ['*']
pull_request:
branches: [master]
repository_dispatch:
types: [rsconnect_python_latest]
workflow_dispatch:
env:
DOCKER_TTY_FLAGS: ''
permissions:
id-token: write
contents: write
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- os: macos-latest
python-version: '3.9'
runs-on: ${{ matrix.os }}
name: test (py${{ matrix.python-version }} ${{ matrix.os }})
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make test
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make version
- run: make yarn
- run: make lint
selenium:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8.x
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make image3.8
- run: make -C selenium build
- run: make -C selenium clean
- run: make -C selenium test-env-up
- run: make -C selenium jupyter-up
- run: make -C selenium test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: selenium-logs
path: '**/*.log'
distributions:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.8.x
- run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- run: make prereqs
- run: make dist
id: create_dist
- uses: actions/upload-artifact@v4
with:
name: distributions
path: dist/
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: python -c 'import rsconnect_jupyter;print(rsconnect_jupyter.__version__)'
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.create_dist.outputs.whl }}
asset_name: ${{ steps.create_dist.outputs.whl_basename }}
asset_content_type: application/x-wheel+zip
- uses: aws-actions/configure-aws-credentials@v1
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/master'
run: make sync-latest-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
docs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: extractions/setup-just@v1
- uses: actions/checkout@v2
- run: just docs/ image build
- uses: actions/upload-artifact@v4
with:
name: docs
path: docs/site/
- uses: aws-actions/configure-aws-credentials@v1
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/master'
run: make sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && (contains(github.ref, 'b') == false)
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.DOCS_AWS_ROLE }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && (contains(github.ref, 'b') == false)
run: make promote-docs-in-s3