forked from kedro-org/kedro-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.35 KB
/
unit-tests.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
name: Run unit tests
on:
workflow_call:
inputs:
plugin:
type: string
os:
type: string
python-version:
type: string
jobs:
unit-tests:
runs-on: ${{ inputs.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{inputs.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{inputs.python-version}}
- name: Cache python packages for Linux
if: inputs.os == 'ubuntu-latest'
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{inputs.plugin}}-${{inputs.os}}-python-${{inputs.python-version}}
restore-keys: ${{inputs.plugin}}
- name: Cache python packages for Windows
if: inputs.os == 'windows-latest'
uses: actions/cache@v4
with:
path: ~\AppData\Local\pip\Cache
key: ${{inputs.plugin}}-${{inputs.os}}-python-${{inputs.python-version}}
restore-keys: ${{inputs.plugin}}
- name: Add MSBuild to PATH
if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
- name: Install uv
run: |
python -m pip install "uv==0.2.21"
- name: Install dependencies
run: |
cd ${{ inputs.plugin }}
uv pip install --system "kedro @ git+https://github.com/kedro-org/kedro@main"
uv pip install --system "${{inputs.plugin}}[test] @ ."
- name: pip freeze
run: uv pip freeze --system
- name: Run unit tests for Linux / kedro-airflow, kedro-docker, kedro-telemetry
if: inputs.os != 'windows-latest' && inputs.plugin != 'kedro-datasets'
run: make plugin=${{ inputs.plugin }} test
- name: Run unit tests for Linux / kedro-datasets
if: inputs.os != 'windows-latest' && inputs.plugin == 'kedro-datasets'
run: make dataset-tests
- name: Run unit tests for Windows / kedro-airflow, kedro-docker, kedro-telemetry
if: inputs.os == 'windows-latest' && inputs.plugin != 'kedro-datasets'
run: |
cd ${{ inputs.plugin }}
pytest tests
- name: Run unit tests for Windows / kedro-datasets / no spark parallel
if: inputs.os == 'windows-latest' && inputs.plugin == 'kedro-datasets'
run: |
make test-no-spark