diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fc0e277 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Compose + run: sudo apt-get update && sudo apt-get install -y docker-compose + + - name: Run tests + run: ./test.sh diff --git a/Dockerfile b/Dockerfile index 97ba761..396ea1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM php:8.1-cli RUN apt-get update && apt-get install -y \ libpq-dev \ mariadb-client \ + unzip \ && docker-php-ext-install pdo pdo_mysql pdo_pgsql # Install xdebug @@ -23,7 +24,7 @@ COPY . /app WORKDIR /app # Install PHP dependencies -RUN composer update +RUN composer update --no-interaction --prefer-dist # Keep the container running by default CMD ["/bin/sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 20a010a..3da7ec3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,6 @@ services: build: context: . dockerfile: Dockerfile - volumes: - - .:/app depends_on: postgres: condition: service_healthy diff --git a/test.sh b/test.sh index 0fe37d5..a4b0f72 100755 --- a/test.sh +++ b/test.sh @@ -3,6 +3,10 @@ # Ensure the script exits on any error set -e +# Uncomment this while changing the Dockerfile +#docker compose down +#docker compose build + # Start the Docker services if not already running docker compose up -d