From cd93dbed22c11329ddef773e6c68ed115c460772 Mon Sep 17 00:00:00 2001 From: Arjen Kroezen Date: Wed, 15 Nov 2023 15:13:54 +0100 Subject: [PATCH] ci: add ci-python.yaml --- .github/workflows/ci-python.yml | 63 +++++++++++++++++++++++++++++++++ src/python/pyproject.toml | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-python.yml diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml new file mode 100644 index 00000000..9f5c19e1 --- /dev/null +++ b/.github/workflows/ci-python.yml @@ -0,0 +1,63 @@ +name: CIPython + +on: [push] + +jobs: + build_and_publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v3 + - name: Set up python + id: setup-python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + working-directory: ./src/python + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + working-directory: ./src/python + run: poetry install --no-interaction --no-root + #---------------------------------------------- + # install your root project, if required + #---------------------------------------------- + - name: Install project + working-directory: ./src/python + run: poetry install --no-interaction + #---------------------------------------------- + # run test suite + #---------------------------------------------- + - name: Run tests + working-directory: ./src/python + run: | + source .venv/bin/activate + pytest tests/ + coverage report \ No newline at end of file diff --git a/src/python/pyproject.toml b/src/python/pyproject.toml index 06c810ac..a1a516dd 100644 --- a/src/python/pyproject.toml +++ b/src/python/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "azure-data-factory-testing-framework-python" +name = "data-factory-testing-framework" version = "0.1.0" description = "" authors = ["Arjen Kroezen "]