50 - Avoid codeload 429 via prefer-source and baked phpstan
This commit is contained in:
parent
e38d700612
commit
42563511b4
3 changed files with 13 additions and 4 deletions
|
|
@ -10,14 +10,14 @@ jobs:
|
||||||
ci:
|
ci:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: forge.lvl0.xyz/lvl0/dishplanner-ci:php8.3-2
|
image: forge.lvl0.xyz/lvl0/dishplanner-ci:php8.3-3
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: https://data.forgejo.org/actions/cache@v4
|
uses: https://data.forgejo.org/actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/composer
|
path: ~/.composer/cache
|
||||||
key: composer-${{ hashFiles('composer.lock') }}
|
key: composer-${{ hashFiles('composer.lock') }}
|
||||||
restore-keys: composer-
|
restore-keys: composer-
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
echo "composer install attempt $attempt/5"
|
echo "composer install attempt $attempt/5"
|
||||||
composer install --no-interaction --prefer-dist && exit 0
|
composer install --no-interaction --prefer-source && exit 0
|
||||||
echo "composer install failed (attempt $attempt/5), retrying in 30s..."
|
echo "composer install failed (attempt $attempt/5), retrying in 30s..."
|
||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
include:
|
include:
|
||||||
- name: dishplanner-ci
|
- name: dishplanner-ci
|
||||||
file: docker/build/Dockerfile.ci
|
file: docker/build/Dockerfile.ci
|
||||||
version: php8.3-2
|
version: php8.3-3
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,12 @@ RUN apt-get update \
|
||||||
&& 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
|
||||||
|
|
||||||
|
# phpstan/phpstan is dist-only (no VCS source), so pre-warm its Composer cache
|
||||||
|
# here to avoid codeload.github.com rate limits during CI's composer install.
|
||||||
|
# Keep the version in sync with composer.lock. Build this image on a network
|
||||||
|
# that isn't codeload-rate-limited (e.g. locally) until #50 is resolved.
|
||||||
|
RUN mkdir -p /tmp/warm && cd /tmp/warm \
|
||||||
|
&& printf '{"require":{"phpstan/phpstan":"2.2.8"}}' > composer.json \
|
||||||
|
&& composer install --no-interaction --no-progress \
|
||||||
|
&& rm -rf /tmp/warm
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue