Skip to content

Handling utf-8

Handling utf-8 #847

Workflow file for this run

name: carrot-cdm
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.10.5]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-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-version: [3.10.5]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.10.5
- 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]
version: [3.10.5]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.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:
version: [3.10.5]
if: "!contains(github.event.head_commit.message, '[ci skip]')"
needs: build
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.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.10.5
- 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.10.5
- 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