diff --git a/.github/workflows/ci-pipeline.yaml b/.github/workflows/ci-pipeline.yaml new file mode 100644 index 0000000..5b9e300 --- /dev/null +++ b/.github/workflows/ci-pipeline.yaml @@ -0,0 +1,47 @@ +name: Continuous Integration + +# Run only on main and feature branches if Python files were changed +on: + push: + branches: + - main + - 'feature/**' + # Deactivated for testing + # paths: + # - '**.py' + +env: + PYTHON_IMAGE: 'python:3.12-slim' + POETRY_VERSION: 2.1.2 + +jobs: + unit-tests: + name: Run Unit Tests + runs-on: ubuntu-latest + container: python:3.12-slim # TODO: How to use a variable here? + env: + POETRY_HOME: '/opt/poetry' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Poetry + run: | + python -m venv $POETRY_HOME + $POETRY_HOME/bin/pip install --no-cache-dir poetry==$POETRY_VERSION + + - name: Install Dependencies + run: | + cd $GITHUB_WORKSPACE + $POETRY_HOME/bin/poetry install --no-root --no-interaction --with=dev + + - name: Run Pytest + run: | + $POETRY_HOME/bin/poetry run pytest tests/ -v + + another-job: + name: I will eventually be a useful job + runs-on: ubuntu-latest + needs: unit-tests + steps: + - run: echo "The unit tests were successful!" \ No newline at end of file