release/v0.8.0 #49
3 changed files with 21 additions and 27 deletions
|
|
@ -10,30 +10,18 @@ jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: forge.lvl0.xyz/lvl0/dishplanner-ci:php8.3-3
|
image: forge.lvl0.xyz/lvl0/dishplanner-ci:php8.3-4
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
|
||||||
uses: https://data.forgejo.org/actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.composer/cache
|
|
||||||
key: composer-${{ hashFiles('composer.lock') }}
|
|
||||||
restore-keys: composer-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
for attempt in 1 2 3 4 5; do
|
|
||||||
echo "composer install attempt $attempt/5"
|
|
||||||
composer install --no-interaction --prefer-source && exit 0
|
|
||||||
echo "composer install failed (attempt $attempt/5), retrying in 30s..."
|
|
||||||
sleep 30
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
run: cp .env.testing .env
|
run: cp .env.testing .env
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: |
|
||||||
|
cp -a /opt/deps/vendor ./vendor
|
||||||
|
composer install --no-interaction --no-progress --prefer-source
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: vendor/bin/pint --test
|
run: vendor/bin/pint --test
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ on:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'docker/build/**'
|
- 'docker/build/**'
|
||||||
|
- 'composer.json'
|
||||||
|
- 'composer.lock'
|
||||||
- '.forgejo/workflows/images.yml'
|
- '.forgejo/workflows/images.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
@ -18,7 +20,7 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- name: dishplanner-ci
|
- name: dishplanner-ci
|
||||||
file: docker/build/Dockerfile.ci
|
file: docker/build/Dockerfile.ci
|
||||||
version: php8.3-3
|
version: php8.3-4
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,15 @@ RUN apt-get update \
|
||||||
|
|
||||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# phpstan/phpstan is dist-only (no VCS source), so pre-warm its Composer cache
|
# Bake the project's PHP dependencies (dev included) into the image so CI
|
||||||
# here to avoid codeload.github.com rate limits during CI's composer install.
|
# restores them with a local copy instead of paying a per-run composer install
|
||||||
# Keep the version in sync with composer.lock. Build this image on a network
|
# over the network. Build this image on a network that isn't
|
||||||
# that isn't codeload-rate-limited (e.g. locally) until #50 is resolved.
|
# codeload-rate-limited (e.g. locally) — the Forgejo runner hits codeload 429
|
||||||
RUN mkdir -p /tmp/warm && cd /tmp/warm \
|
# under --prefer-dist.
|
||||||
&& printf '{"require":{"phpstan/phpstan":"2.2.8"}}' > composer.json \
|
#
|
||||||
&& composer install --no-interaction --no-progress \
|
# --no-scripts skips `php artisan package:discover` (the app isn't present
|
||||||
&& rm -rf /tmp/warm
|
# here). CI runs `composer install` after restoring vendor, which regenerates
|
||||||
|
# bootstrap/cache and tops up any lockfile drift between main and release/*.
|
||||||
|
WORKDIR /opt/deps
|
||||||
|
COPY composer.json composer.lock ./
|
||||||
|
RUN composer install --no-interaction --no-progress --prefer-dist --no-scripts
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue