From 5df9f9cbf5cf2d619089f66784ec61d7ff8dfdb4 Mon Sep 17 00:00:00 2001 From: Julien M'Poy Date: Sun, 10 Nov 2024 10:10:30 +0100 Subject: [PATCH] Add tests run in CI --- .github/workflows/ci.yml | 10 +++++++++- test.sh | 14 ++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d83161e..02f4788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,18 @@ jobs: uses: redhat-actions/buildah-build@v2 with: image: docker.io/groovytron/python - tags: 3.12 + tags: 3.12 3.12-${{ github.sha }} containerfiles: | ./3.12/Dockerfile build-args: | BUILD_DATE=${{ steps.date.outputs.date }} VCS_REF=${{ github.sha }} POETRY_VERSION=1.8.4 + - name: Test the image + run: | + podman run + -it + --volume $(pwd):/var/www/app:rw + --user dev + docker.io/groovytron/python:3.12 + bash ./test.sh diff --git a/test.sh b/test.sh index db94393..4dc6ed1 100755 --- a/test.sh +++ b/test.sh @@ -1,7 +1,6 @@ #!/bin/bash PROJECT_NAME=testsite -PIPENV_PROJECT_DIR=test_pipenv POETRY_PROJECT_DIR=test_poetry python --version @@ -12,19 +11,10 @@ pipenv --version poetry --version # Create repository folders -mkdir -p "$PIPENV_PROJECT_DIR" "$POETRY_PROJECT_DIR" - -# Pipenv test -cd "$PIPENV_PROJECT_DIR" - -pipenv install django || exit 1 -echo 'Creating test django project with pipenv...' - -pipenv run django-admin startproject "$PROJECT_NAME" || exit 1 -echo 'Django project created with pipenv.' +mkdir -p "$POETRY_PROJECT_DIR" # Poetry test -cd "../$POETRY_PROJECT_DIR" +cd "$POETRY_PROJECT_DIR" || exit 1 poetry init --no-interaction