-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (104 loc) · 3.68 KB
/
test-kedro-new.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# This is simple workflow to test kedro new command
name: "Test `kedro new`"
on: [push]
jobs:
test_kedro_new:
name: "Test kedro new"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory: ["mini-poetry"]
starter: [".", "https://github.com/rnoxy/kedro-starters"]
include:
- python-version: "3.9"
- kedro-version: "0.18.14"
- starter: "https://github.com/rnoxy/kedro-starters"
branch_name: ${GITHUB_REF#refs/heads/}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install kedro
run: |
python -m pip install --upgrade pip
pip install kedro==${{ matrix.kedro-version }}
- name: Show kedro info
run: kedro info
- name: Run kedro new (local)
if: matrix.starter == '.'
run: |
kedro new \
--starter ${{ matrix.starter }} \
--directory ${{ matrix.directory }} \
--config ${{ matrix.directory }}/tests/config.yml \
--verbose
- name: Run kedro new (remote)
if: matrix.starter != '.'
run: |
kedro new \
--starter ${{ matrix.starter }} \
--directory ${{ matrix.directory }} \
--checkout ${{ matrix.branch_name }} \
--config ${{ matrix.directory }}/tests/config.yml \
--verbose
- name: Check that the project directory exists
run: |
if [ ! -d test-project ]; then
echo "test-project directory does not exist"
exit 1
fi
- name: Check that major project files exist
run: |
for file in \
README.md \
src/test_project/settings.py \
src/test_project/pipeline_registry.py \
src/test_project/__init__.py \
src/test_project/__main__.py;
do
if [ ! -f test-project/$file ]; then
echo "$file does not exist"
exit 1
fi
done
test_project_build:
name: "Test project build"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory: ["mini-poetry"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
kedro-init-version: ["0.18.14"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install kedro
run: |
python -m pip install --upgrade pip
pip install kedro==${{ matrix.kedro-init-version }}
- name: Init kedro project
run: kedro new --starter ./${{ matrix.directory }} --config ${{ matrix.directory }}/tests/config.yml --verbose
- name: Install dependencies with poetry
working-directory: test-project
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry config virtualenvs.create false
poetry install --with test
- name: Run kedro
working-directory: test-project
env:
COLUMNS: 200
run: kedro run --env=test
- name: Run tests (pytest)
working-directory: test-project
run: pytest