57 - Fix MySQL readiness check and bump CI image to php8.3-2
Some checks failed
CI / ci (push) Failing after 1s
CI / build (push) Failing after 34s
Build and Push CI Image / images (docker/build/Dockerfile.ci, incr-ci, php8.3-2) (push) Successful in 6m49s
CI / ci (pull_request) Failing after 2m39s
CI / build (pull_request) Failing after 34s
Some checks failed
CI / ci (push) Failing after 1s
CI / build (push) Failing after 34s
Build and Push CI Image / images (docker/build/Dockerfile.ci, incr-ci, php8.3-2) (push) Successful in 6m49s
CI / ci (pull_request) Failing after 2m39s
CI / build (pull_request) Failing after 34s
This commit is contained in:
parent
1c42b5456c
commit
7809dce474
3 changed files with 10 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: forge.lvl0.xyz/lvl0/incr-ci:php8.3-1
|
image: forge.lvl0.xyz/lvl0/incr-ci:php8.3-2
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
|
|
@ -40,10 +40,15 @@ jobs:
|
||||||
- name: Wait for MySQL
|
- name: Wait for MySQL
|
||||||
run: |
|
run: |
|
||||||
for i in $(seq 1 30); do
|
for i in $(seq 1 30); do
|
||||||
nc -z db 3306 && echo "MySQL is up" && break
|
if php -r 'exit(@fsockopen("db", 3306) ? 0 : 1);'; then
|
||||||
|
echo "MySQL is up after ${i} attempt(s)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
echo "Waiting for MySQL... ($i/30)"
|
echo "Waiting for MySQL... ($i/30)"
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
echo "MySQL never became reachable on db:3306" >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Run migrations
|
- name: Run migrations
|
||||||
run: php artisan migrate --force
|
run: php artisan migrate --force
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- name: incr-ci
|
- name: incr-ci
|
||||||
file: docker/build/Dockerfile.ci
|
file: docker/build/Dockerfile.ci
|
||||||
version: php8.3-1
|
version: php8.3-2
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ RUN install-php-extensions \
|
||||||
gd \
|
gd \
|
||||||
pcov
|
pcov
|
||||||
|
|
||||||
# netcat-openbsd backs the MySQL readiness check in ci.yml.
|
|
||||||
# nodejs is not used by the app's tests; the Forgejo JavaScript actions
|
# nodejs is not used by the app's tests; the Forgejo JavaScript actions
|
||||||
# (checkout, cache) are executed with it inside this container.
|
# (checkout, cache) are executed with it inside this container.
|
||||||
|
# The MySQL readiness check in ci.yml uses PHP's fsockopen, so no netcat here.
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends git unzip nodejs netcat-openbsd \
|
&& apt-get install -y --no-install-recommends git unzip nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue