Skip to content

conda section

conda section #51

Workflow file for this run

# 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
- name: Run kedro
working-directory: test-project
run: kedro run --env=test
- name: Run tests (pytest)
working-directory: test-project
run: pytest