-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from utopia-php/feat-improve-features
Improve Migrations Stablity
- Loading branch information
Showing
40 changed files
with
3,090 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
push: { branches: [main] } | ||
|
||
jobs: | ||
tests: | ||
name: Run Test Suite | ||
runs-on: ubuntu-latest | ||
env: | ||
COMPOSE_FILE: docker-compose.yml | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Tests | ||
run: | | ||
docker-compose up -d --build && sleep 5 && docker compose exec tests php ./vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,37 @@ | ||
FROM postgres:alpine3.18 as supabase-db | ||
COPY ./tests/Transfer/resources/supabase/backup.tar /docker-entrypoint-initdb.d/backup.tar | ||
COPY ./tests/Transfer/resources/restore.sh /docker-entrypoint-initdb.d/restore.sh | ||
FROM supabase/postgres:15.1.0.96 as supabase-db | ||
COPY ./tests/Transfer/resources/supabase/1_globals.sql /docker-entrypoint-initdb.d/1_globals.sql | ||
COPY ./tests/Transfer/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 | ||
COPY ./tests/Transfer/resources/nhost/backup.tar /docker-entrypoint-initdb.d/backup.tar | ||
COPY ./tests/Transfer/resources/restore.sh /docker-entrypoint-initdb.d/restore.sh | ||
COPY ./tests/Transfer/resources/nhost/1_globals.sql /docker-entrypoint-initdb.d/1_globals.sql | ||
COPY ./tests/Transfer/resources/nhost/2_main.sql /docker-entrypoint-initdb.d/2_main.sql | ||
|
||
# Use my fork of mockoon while waiting for range headers to be merged | ||
FROM node:14-alpine3.14 as mock-api | ||
FROM node:20.4-alpine3.17 as mock-api | ||
WORKDIR /app | ||
RUN git clone https://github.com/PineappleIOnic/mockoon.git . | ||
RUN apk add --no-cache git | ||
RUN git clone https://github.com/PineappleIOnic/mockoon.git | ||
WORKDIR /app/mockoon | ||
RUN git checkout origin/feat-implement-range | ||
RUN apk add python3 make gcc g++ | ||
RUN npm run bootstrap | ||
RUN npm run build:libs | ||
RUN npm run build:cli | ||
RUN mv ./packages/cli/dist/run /usr/local/bin/mockoon | ||
RUN cd packages/cli && npm install -g . | ||
RUN adduser --shell /bin/sh --disabled-password --gecos "" mockoon | ||
USER mockoon | ||
CMD mockoon-cli start --data /mockoon/api.json --port 80 --disable-log-to-file && tail -f /dev/null | ||
|
||
FROM composer:2.0 as composer | ||
|
||
WORKDIR /usr/local/src/ | ||
|
||
COPY composer.lock /usr/local/src/ | ||
COPY composer.json /usr/local/src/ | ||
|
||
RUN composer install --ignore-platform-reqs | ||
|
||
FROM php:8.0-fpm-alpine3.14 as tests | ||
FROM php:8.1.21-fpm-alpine3.18 as tests | ||
RUN set -ex && apk --no-cache add postgresql-dev | ||
RUN docker-php-ext-install pdo pdo_pgsql | ||
COPY ./src /usr/local/src | ||
COPY ./tests /usr/local/src/tests | ||
COPY --from=composer /usr/local/src/vendor /usr/local/src/vendor | ||
CMD php ./vendor/bin/phpunit | ||
COPY ./src /app/src | ||
COPY ./tests /app/src/tests | ||
COPY --from=composer /usr/local/src/vendor /app/vendor | ||
CMD tail -f /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.