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:
|
2024-01-23 23:30:53 -05:00
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
paths:
|
|
|
|
- "superset/**"
|
2021-01-07 03:47:00 -05:00
|
|
|
pull_request:
|
2021-01-21 19:10:17 -05:00
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
2024-01-23 23:30:53 -05:00
|
|
|
paths:
|
|
|
|
- "superset/**"
|
2020-11-24 14:40:16 -05:00
|
|
|
|
|
|
|
jobs:
|
2021-02-05 15:54:37 -05:00
|
|
|
python-lint:
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-05-10 13:21:56 -04:00
|
|
|
python-version: ["3.9"]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2023-04-14 11:23:00 -04:00
|
|
|
uses: actions/checkout@v3
|
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'
|
2023-05-02 01:59:00 -04:00
|
|
|
uses: actions/setup-python@v4
|
2020-11-24 14:40:16 -05:00
|
|
|
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-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-05-10 13:21:56 -04:00
|
|
|
python-version: ["3.9"]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2023-04-14 11:23:00 -04:00
|
|
|
uses: actions/checkout@v3
|
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
|
2023-05-02 01:59:00 -04:00
|
|
|
uses: actions/setup-python@v4
|
2020-11-24 14:40:16 -05:00
|
|
|
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
|
2023-10-13 14:00:09 -04:00
|
|
|
run: |
|
|
|
|
if ! pre-commit run --all-files; then
|
|
|
|
git status
|
|
|
|
git diff
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-11-24 14:40:16 -05:00
|
|
|
|
|
|
|
babel-extract:
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 14:40:16 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-05-10 13:21:56 -04:00
|
|
|
python-version: ["3.9"]
|
2020-11-24 14:40:16 -05:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2023-04-14 11:23:00 -04:00
|
|
|
uses: actions/checkout@v3
|
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
|
2023-05-02 01:59:00 -04:00
|
|
|
uses: actions/setup-python@v4
|
2020-11-24 14:40:16 -05:00
|
|
|
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
|