forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (99 loc) · 3.53 KB
/
python-versions.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
name: Python Versions
on:
push:
branches:
- 'develop'
- 'feature/**'
pull_request:
types: [opened, synchronize, reopened]
# Allows workflow to be called from other workflows
workflow_call:
inputs:
ref:
required: true
type: string
secrets:
PARAMETER_PASSWORD:
description: 'Token passed from caller workflows for snowflake integration tests'
required: true
# Avoid duplicate workflows on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-python
cancel-in-progress: true
defaults:
run:
shell: bash --login -eo pipefail {0}
jobs:
py_version:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
min-or-max: ["min", "max"]
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: 'recursive'
# Set $PYTHON_VERSION from either $PYTHON_MIN_VERSION or $PYTHON_MAX_VERSION,
# depending on our 'min-or-max' strategy matrix value.
- name: Set Python version vars
uses: ./.github/actions/set_python_versions
- if: ${{ matrix.min-or-max == 'min' }}
run: echo "PYTHON_VERSION=${{ env.PYTHON_MIN_VERSION }}" >> $GITHUB_ENV
- if: ${{ matrix.min-or-max == 'max' }}
run: echo "PYTHON_VERSION=${{ env.PYTHON_MAX_VERSION }}" >> $GITHUB_ENV
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Run Linters
run: |
PRE_COMMIT_NO_CONCURRENCY=true pipenv run pre-commit run --show-diff-on-failure --color=always --all-files
- name: Run Type Checkers
run: scripts/mypy --report
- name: Run Python Tests
run: make pytest
- name: Run Integration Tests
run: make integration-tests
- name: CLI Smoke Tests
run: make cli-smoke-tests
py_snowflake:
runs-on: ubuntu-latest
# Runs triggered by PRs from forks or by dependabot won't run this job, since that PR wouldn't have secrets access
# See: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
# Runs triggered by Release/RC are workflow_dispatch events ; Nightly is a schedule event
if: |
github.repository == 'streamlit/streamlit' && (
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'schedule')
)
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: 'recursive'
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Decrypt credentials
run: ./.github/scripts/decrypt_credentials.sh
env:
PARAMETER_PASSWORD: ${{ secrets.PARAMETER_PASSWORD }}
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Run Python Tests for Snowflake
run: make pytest-snowflake