Skip to content

Nightly Build

Nightly Build #232

Workflow file for this run

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 Python version vars
uses: ./.github/actions/set_python_versions
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@v4
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- 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_ID: ${{ github.run_id }}
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}}
secrets:
PARAMETER_PASSWORD: ${{ secrets.PARAMETER_PASSWORD }}
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 }}
RUN_ID: ${{ github.run_id }}
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 Python version vars
uses: ./.github/actions/set_python_versions
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@v4
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- 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_ID: ${{ github.run_id }}
run: python scripts/slack_notifications.py nightly build