forked from kedro-org/kedro-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 2.23 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
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@v3
- name: Set up Python ${{inputs.python-version}}
uses: actions/setup-python@v3
with:
python-version: ${{inputs.python-version}}
- name: Cache python packages for Linux
if: inputs.os == 'ubuntu-latest'
uses: actions/cache@v3
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@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{inputs.plugin}}-${{inputs.os}}-python-${{inputs.python-version}}
restore-keys: ${{inputs.plugin}}
- name: Install Kedro
run: pip install git+https://github.com/kedro-org/kedro@main
- name: Add MSBuild to PATH
if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1
- name: Install dependencies
run: |
cd ${{ inputs.plugin }}
pip install ".[test]"
- name: pip freeze
run: pip freeze
- 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