Skip to content

Commit

Permalink
Merge branch 'integration-test-with-docker-on-github-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
mindplay-dk committed May 27, 2024
1 parent 9e0bbb1 commit 61712a4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ services:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
depends_on:
postgres:
condition: service_healthy
Expand Down
4 changes: 4 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 61712a4

Please sign in to comment.