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:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: forge.lvl0.xyz/lvl0/incr-ci:php8.3-1
|
||||
image: forge.lvl0.xyz/lvl0/incr-ci:php8.3-2
|
||||
|
||||
services:
|
||||
db:
|
||||
|
|
@ -40,10 +40,15 @@ jobs:
|
|||
- name: Wait for MySQL
|
||||
run: |
|
||||
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)"
|
||||
sleep 2
|
||||
done
|
||||
echo "MySQL never became reachable on db:3306" >&2
|
||||
exit 1
|
||||
|
||||
- name: Run migrations
|
||||
run: php artisan migrate --force
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
include:
|
||||
- name: incr-ci
|
||||
file: docker/build/Dockerfile.ci
|
||||
version: php8.3-1
|
||||
version: php8.3-2
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ RUN install-php-extensions \
|
|||
gd \
|
||||
pcov
|
||||
|
||||
# netcat-openbsd backs the MySQL readiness check in ci.yml.
|
||||
# nodejs is not used by the app's tests; the Forgejo JavaScript actions
|
||||
# (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 \
|
||||
&& 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/*
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
|
|
|||
Loading…
Reference in a new issue