2020-11-24 14:40:16 -05:00
|
|
|
# Python Misc unit tests
|
|
|
|
name: Python Misc
|
|
|
|
|
2021-01-07 03:47:00 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- "dependabot/npm_and_yarn/**"
|
|
|
|
pull_request:
|
2021-01-21 19:10:17 -05:00
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
2020-11-24 14:40:16 -05:00
|
|
|
|
|
|
|
jobs:
|
2021-02-05 15:54:37 -05:00
|
|
|
python-lint:
|
2021-01-21 19:10:17 -05:00
|
|
|
if: github.event.pull_request.draft == false
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-05 04:35:14 -04:00
|
|
|
python-version: [3.8]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2020-11-24 14:40:16 -05:00
|
|
|
uses: actions/checkout@v2
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2021-02-05 10:40:08 -05:00
|
|
|
- name: Check if python changes are present
|
|
|
|
id: check
|
|
|
|
env:
|
|
|
|
GITHUB_REPO: ${{ github.repository }}
|
|
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
|
|
continue-on-error: true
|
|
|
|
run: ./scripts/ci_check_no_file_changes.sh python
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Setup Python
|
2021-10-08 02:13:01 -04:00
|
|
|
if: steps.check.outcome == 'failure'
|
2020-11-24 14:40:16 -05:00
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-10-29 19:29:54 -04:00
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "requirements/testing.txt"
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Install dependencies
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2021-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-11-24 14:40:16 -05:00
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
apt-get-install
|
|
|
|
pip-upgrade
|
2021-11-26 11:21:01 -05:00
|
|
|
pip install wheel
|
2020-11-24 14:40:16 -05:00
|
|
|
pip install -r requirements/testing.txt
|
|
|
|
- name: pylint
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2020-11-24 14:40:16 -05:00
|
|
|
# `-j 0` run Pylint in parallel
|
|
|
|
run: pylint -j 0 superset
|
|
|
|
|
|
|
|
pre-commit:
|
2021-01-21 19:10:17 -05:00
|
|
|
if: github.event.pull_request.draft == false
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-05 04:35:14 -04:00
|
|
|
python-version: [3.8]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2020-11-24 14:40:16 -05:00
|
|
|
uses: actions/checkout@v2
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-10-29 19:29:54 -04:00
|
|
|
cache: "pip"
|
2021-12-29 09:05:53 -05:00
|
|
|
cache-dependency-path: |
|
|
|
|
requirements/base.txt
|
|
|
|
requirements/integration.txt
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Install dependencies
|
2021-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-11-24 14:40:16 -05:00
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
apt-get-install
|
|
|
|
pip-upgrade
|
2021-11-26 11:21:01 -05:00
|
|
|
pip install wheel
|
2021-12-29 09:05:53 -05:00
|
|
|
pip install -r requirements/base.txt
|
2020-11-24 14:40:16 -05:00
|
|
|
pip install -r requirements/integration.txt
|
2022-10-29 19:29:54 -04:00
|
|
|
# Add brew to the path - see https://github.com/actions/runner-images/issues/6283
|
|
|
|
- name: Enable brew and helm-docs
|
|
|
|
run: |
|
|
|
|
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
|
|
|
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
|
|
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >>"${GITHUB_ENV}"
|
|
|
|
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >>"${GITHUB_ENV}"
|
|
|
|
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}"
|
|
|
|
brew install norwoodj/tap/helm-docs
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: pre-commit
|
|
|
|
run: pre-commit run --all-files
|
|
|
|
|
|
|
|
babel-extract:
|
2021-01-21 19:10:17 -05:00
|
|
|
if: github.event.pull_request.draft == false
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-05 04:35:14 -04:00
|
|
|
python-version: [3.8]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2020-11-24 14:40:16 -05:00
|
|
|
uses: actions/checkout@v2
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2022-10-29 19:29:54 -04:00
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "requirements/base.txt"
|
2020-11-24 14:40:16 -05:00
|
|
|
- name: Install dependencies
|
2021-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-11-24 14:40:16 -05:00
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
apt-get-install
|
|
|
|
pip-upgrade
|
2021-11-26 11:21:01 -05:00
|
|
|
pip install wheel
|
2020-11-24 14:40:16 -05:00
|
|
|
pip install -r requirements/base.txt
|
|
|
|
- name: Test babel extraction
|
|
|
|
run: flask fab babel-extract --target superset/translations --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _,__,t,tn,tct
|