Skip to content

Commit

Permalink
Merge pull request #27 from utopia-php/backups
Browse files Browse the repository at this point in the history
Backups
  • Loading branch information
abnegate authored Aug 23, 2024
2 parents f18d44d + 420cb3b commit 33d2fed
Show file tree
Hide file tree
Showing 53 changed files with 6,758 additions and 2,515 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Tests
on:
pull_request:
push: { branches: [main] }
push:
branches:
- main

jobs:
tests:
Expand All @@ -12,8 +14,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run Tests
run: |
docker-compose up -d --build && sleep 5 && docker compose exec tests php ./vendor/bin/phpunit
docker compose up -d --build
sleep 5
docker compose exec tests php vendor/bin/phpunit
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
composer.lock
/vendor/
/.idea/
*.cache
Expand Down
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
FROM supabase/postgres:15.1.0.96 as supabase-db
FROM supabase/postgres:15.1.0.96 AS supabase-db

COPY tests/Migration/resources/supabase/1_globals.sql /docker-entrypoint-initdb.d/1_globals.sql
COPY tests/Migration/resources/supabase/2_main.sql /docker-entrypoint-initdb.d/2_main.sql

RUN rm -rf /docker-entrypoint-initdb.d/migrate.sh

FROM postgres:alpine3.18 as nhost-db
FROM postgres:alpine3.18 AS nhost-db

COPY tests/Migration/resources/nhost/1_globals.sql /docker-entrypoint-initdb.d/1_globals.sql
COPY tests/Migration/resources/nhost/2_main.sql /docker-entrypoint-initdb.d/2_main.sql

FROM composer:2.0 as composer
WORKDIR /usr/local/src/
COPY composer.json /usr/local/src/
FROM composer:2.0 AS composer

COPY composer.json /app
COPY composer.lock /app

RUN composer install --ignore-platform-reqs

FROM php:8.1.21-fpm-alpine3.18 as tests
FROM php:8.3.10-cli-alpine3.20 AS tests

# Postgres
RUN set -ex \
&& apk --no-cache add postgresql-libs postgresql-dev \
&& docker-php-ext-install pdo pdo_pgsql \
&& apk del postgresql-dev

COPY ./src /app/src
COPY ./tests /app/src/tests
COPY --from=composer /usr/local/src/vendor /app/vendor

COPY --from=composer /app/vendor /app/vendor

WORKDIR /app

CMD tail -f /dev/null
Loading

0 comments on commit 33d2fed

Please sign in to comment.