2021-02-11 13:19:41 -05:00
|
|
|
# Python unit tests
|
2021-07-12 03:00:18 -04:00
|
|
|
name: Python-Unit
|
2021-01-07 03:47:00 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-01-23 23:30:53 -05:00
|
|
|
branches:
|
2024-03-06 12:23:07 -05:00
|
|
|
- "master"
|
|
|
|
- "[0-9].[0-9]"
|
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]
|
2021-01-07 03:47:00 -05:00
|
|
|
|
2024-02-01 10:08:41 -05:00
|
|
|
# cancel previous workflow jobs for PRs
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-01-07 03:47:00 -05:00
|
|
|
jobs:
|
2021-07-12 03:00:18 -04:00
|
|
|
unit-tests:
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-07 03:47:00 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-10 17:32:30 -04:00
|
|
|
python-version: ["current", "next"]
|
2021-01-07 03:47:00 -05:00
|
|
|
env:
|
|
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2024-04-08 19:20:25 -04:00
|
|
|
- name: Check for file changes
|
2021-02-05 10:40:08 -05:00
|
|
|
id: check
|
2024-04-08 19:20:25 -04:00
|
|
|
uses: ./.github/actions/change-detector/
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-07 03:47:00 -05:00
|
|
|
- name: Setup Python
|
2024-03-18 21:39:41 -04:00
|
|
|
uses: ./.github/actions/setup-backend/
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2021-01-07 03:47:00 -05:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2021-07-12 03:00:18 -04:00
|
|
|
- name: Python unit tests
|
2024-04-08 19:20:25 -04:00
|
|
|
if: steps.check.outputs.python
|
2023-03-10 19:07:50 -05:00
|
|
|
env:
|
|
|
|
SUPERSET_TESTENV: true
|
2024-03-18 21:39:41 -04:00
|
|
|
SUPERSET_SECRET_KEY: not-a-secret
|
2021-01-07 03:47:00 -05:00
|
|
|
run: |
|
2022-04-03 19:27:43 -04:00
|
|
|
pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear
|
2021-01-07 03:47:00 -05:00
|
|
|
- name: Upload code coverage
|
2024-04-30 18:32:33 -04:00
|
|
|
uses: codecov/codecov-action@v4
|
|
|
|
with:
|
|
|
|
flags: python,unit
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
verbose: true
|