forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (135 loc) · 5 KB
/
nightly.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
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Nightly Build
on:
schedule:
# Run job at 10.30pm PST or 11.30pm PDT
- cron: '30 6 * * *'
jobs:
create-nightly-tag:
runs-on: ubuntu-latest
if: github.repository == 'streamlit/streamlit'
defaults:
run:
shell: bash --login -eo pipefail {0}
permissions:
# Additional permission needed to generate tag
contents: write
outputs:
TAG: ${{ steps.create_tag.outputs.tag }}
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Create tag
id: create_tag
run: |
git config --global user.email "core+streamlitbot-github@streamlit.io"
git config --global user.name "Streamlit Bot"
TAG="$(./scripts/pypi_nightly_create_tag.py)"
echo "tag=$TAG" >> $GITHUB_OUTPUT
./scripts/update_version.py $TAG
./scripts/update_name.py streamlit-nightly
git add lib/setup.py frontend/package.json lib/streamlit/__init__.py lib/streamlit/version.py
git commit -m "Update version and project name in files"
git tag -a $TAG -m "Streamlit nightly $TAG"
git push origin $TAG
- if: ${{ failure() }}
name: Nightly Tag Failure Slack Message
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: python scripts/slack_notifications.py nightly tag
run-python-tests:
needs: create-nightly-tag
uses: ./.github/workflows/python-versions.yml
with:
ref: ${{needs.create-nightly-tag.outputs.tag}}
run-javascript-tests:
needs: create-nightly-tag
uses: ./.github/workflows/js-tests.yml
with:
ref: ${{needs.create-nightly-tag.outputs.tag}}
run-py-prod-deps-smoke-test:
needs: create-nightly-tag
uses: ./.github/workflows/py-prod-deps-smoke-test.yml
with:
ref: ${{needs.create-nightly-tag.outputs.tag}}
run-cypress-tests:
needs: create-nightly-tag
uses: ./.github/workflows/cypress.yml
with:
ref: ${{needs.create-nightly-tag.outputs.tag}}
test-status-notification:
runs-on: ubuntu-latest
if: ${{ always() }}
# By default, jobs listed in needs must all complete successfully for the dependent job to run. always() conditional
# added as we'd like this job to run whether or not tests pass & slack us regarding failing tests.
needs: [create-nightly-tag, run-python-tests, run-javascript-tests, run-py-prod-deps-smoke-test, run-cypress-tests]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
ref: ${{ needs.create-nightly-tag.outputs.tag }}
persist-credentials: false
submodules: 'recursive'
- if: ${{ needs.run-python-tests.result == 'failure' }}
run: python scripts/slack_notifications.py nightly python
- if: ${{ needs.run-javascript-tests.result == 'failure' }}
run: python scripts/slack_notifications.py nightly js
- if: ${{ needs.run-py-prod-deps-smoke-test.result == 'failure' }}
run: python scripts/slack_notifications.py nightly py_prod
- if: ${{ needs.run-cypress-tests.result == 'failure' }}
run: python scripts/slack_notifications.py nightly cypress
create-nightly-build:
runs-on: ubuntu-latest
# Tag creation & tests must all complete successfully for nightly build job to run.
needs: [create-nightly-tag, run-python-tests, run-javascript-tests, run-py-prod-deps-smoke-test, run-cypress-tests]
defaults:
run:
shell: bash --login -eo pipefail {0}
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
ref: ${{ needs.create-nightly-tag.outputs.tag }}
persist-credentials: false
submodules: 'recursive'
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Verify git tag vs. version
env:
TAG: ${{ needs.create-nightly-tag.outputs.tag }}
run: |
cd lib
python setup.py verify
- name: Build Package
timeout-minutes: 120
run: |
sudo apt install rsync
make package
- name: Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.NIGHTLY_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.NIGHTLY_PYPI_API_TOKEN }}
run: |
make distribute
- if: ${{ failure() }}
name: Nightly Build Failure Slack Message
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: python scripts/slack_notifications.py nightly build