-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (153 loc) · 5.38 KB
/
ci.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: carrot-cdm
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-major-version: [3]
python-minor-version: [8, 9, 10, 11]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
- uses: actions/checkout@v2
- run: ls .
- name: Install setuptools
run: pip3 install setuptools
- name: Install carrot-tools
run: pip3 install -e .
- run: carrot --help
unit_test_py_config:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-major-version: [3]
python-minor-version: [8, 9, 10, 11]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
- uses: actions/checkout@v2
- run: ls .
- name: Install setuptools
run: pip3 install setuptools
- name: Install carrot-tools
run: pip3 install -e .
- run: carrot display rules json carrot/data/example/sample_config/lion_structural_mapping.json
- run: carrot run py make --name Lion --register carrot/data/example/sample_config/lion_structural_mapping.json
- run: carrot run py list
- run: carrot run py map --conf Lion.py carrot/data/example/sample_input_data/*.csv
- uses: actions/upload-artifact@v2
with:
name: outputs
path: output_data
retention-days: 1
unit_test_json_config_unix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-major-version: [3]
python-minor-version: [8, 9, 10, 11]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
- uses: actions/checkout@v2
- run: ls .
- name: Install setuptools
run: pip3 install setuptools
- name: Install carrot-tools
run: pip3 install -e .
- run: |
CARROT_DATA_FOLDER=$(carrot info data_folder)
carrot run map --rules $CARROT_DATA_FOLDER/test/rules/rules_14June2021.json --output-folder tests/ $CARROT_DATA_FOLDER/test/inputs/*.csv -nc 100
rm -rf tests/
carrot run map --rules $CARROT_DATA_FOLDER/test/rules/rules_14June2021.json --output-folder tests/ $CARROT_DATA_FOLDER/test/inputs/*.csv
- run: |
for filename in tests/*.tsv; do
fname=${filename##*/}
carrot display diff $filename carrot/data/test/expected_outputs/$fname
done
- uses: actions/upload-artifact@v2
with:
name: test
path: tests
retention-days: 1
unit_test_json_config_windows:
runs-on: windows-latest
strategy:
matrix:
python-major-version: [3]
python-minor-version: [8, 9, 10, 11]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ format('{0}.{1}', matrix.python-major-version, matrix.python-minor-version) }}
- uses: actions/checkout@v2
- run: ls .
- name: Install setuptools
run: pip3 install setuptools
- name: Install carrot-tools
run: pip3 install -e .
- run: |
carrot run map --rules carrot\data\test\rules\rules_14June2021.json --output-folder tests carrot\data\test\inputs
- run: |
$files = Get-ChildItem tests\*.tsv
Foreach ($file in $files )
{
$newFile = $file.FullName
$refFile = $('carrot\data\test\expected_outputs\' + $file.Name)
$command = $('carrot display diff ' + $newFile + ' ' + $refFile)
Invoke-expression $command
}
- uses: actions/upload-artifact@v2
with:
name: test
path: tests
retention-days: 1
pypi:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip3 install wheel
- uses: actions/checkout@v2
- run: |
echo "__version__ = '${GITHUB_REF#refs/*/}'" > carrot/_version.py
cat carrot/_version.py
python3 setup.py sdist bdist_wheel
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
unit_test_automation:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/checkout@v2
- name: Install setuptools
run: pip3 install setuptools
- name: Install carrot-tools
run: pip3 install -e .
- name: Run automation ETL
run: |
cd carrot/data/test
carrot etl --config automation/example.yml