Skip to content

Commit

Permalink
Add tests run in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
groovytron committed Nov 10, 2024
1 parent 11d5222 commit 5df9f9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 2 additions & 12 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

PROJECT_NAME=testsite
PIPENV_PROJECT_DIR=test_pipenv
POETRY_PROJECT_DIR=test_poetry

python --version
Expand All @@ -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

Expand Down

0 comments on commit 5df9f9c

Please sign in to comment.