mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
* chore: move memoized test into a separated file create integration test workflow * chore: create unit test workflow to run purely pytest * fix: bad reference * fix: remove pip requirements bc there aren't any yet * temp: install unit dependencies directly * fix: --rootdir= * fix: try to run only unit test * chore: decouple memoized as separated module * fix: bring back dependencies bc superset top-level module is coupled to flask and others so no reason no to do it * fix: reference * fix: pre-commit * fix: pylint
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
# Python unit tests
|
|
name: Python-Unit
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- "dependabot/npm_and_yarn/**"
|
|
pull_request:
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
|
|
|
jobs:
|
|
unit-tests:
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.7,3.8]
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
steps:
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
persist-credentials: false
|
|
submodules: recursive
|
|
- 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
|
|
- name: Setup Python
|
|
if: steps.check.outcome == 'failure'
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
# TODO: separated requiermentes.txt file just for unit tests
|
|
- name: Install dependencies
|
|
if: steps.check.outcome == 'failure'
|
|
uses: ./.github/actions/cached-dependencies
|
|
with:
|
|
run: |
|
|
apt-get-install
|
|
pip-upgrade
|
|
pip install -r requirements/testing.txt
|
|
mkdir ${{ github.workspace }}/.temp
|
|
- name: Python unit tests
|
|
if: steps.check.outcome == 'failure'
|
|
run: |
|
|
pytest ./tests/unit_tests --cache-clear
|
|
- name: Upload code coverage
|
|
if: steps.check.outcome == 'failure'
|
|
run: |
|
|
bash .github/workflows/codecov.sh -c -F python -F unit
|