Compare commits
2 commits
0e79599606
...
763fc17041
| Author | SHA1 | Date | |
|---|---|---|---|
| 763fc17041 | |||
| 334a7ccd70 |
3 changed files with 62 additions and 32 deletions
22
.forgejo/ci/Dockerfile
Normal file
22
.forgejo/ci/Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# CI image: catthehacker/ubuntu:act-latest + PHP 8.4 + extensions + Composer
|
||||||
|
# Used by .forgejo/workflows/ci.yml — built/pushed by .forgejo/workflows/ci-image.yml
|
||||||
|
FROM catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN add-apt-repository -y ppa:ondrej/php \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
php8.4-cli \
|
||||||
|
php8.4-pgsql \
|
||||||
|
php8.4-mbstring \
|
||||||
|
php8.4-xml \
|
||||||
|
php8.4-dom \
|
||||||
|
php8.4-intl \
|
||||||
|
php8.4-pcov \
|
||||||
|
&& update-alternatives --set php /usr/bin/php8.4 \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Composer (latest 2.x, static binary from official image)
|
||||||
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
40
.forgejo/workflows/ci-image.yml
Normal file
40
.forgejo/workflows/ci-image.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
name: Build CI Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- '.forgejo/ci/Dockerfile'
|
||||||
|
- '.forgejo/workflows/ci-image.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.forgejo/ci/Dockerfile'
|
||||||
|
- '.forgejo/workflows/ci-image.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: https://data.forgejo.org/docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Forgejo Registry
|
||||||
|
uses: https://data.forgejo.org/docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: forge.lvl0.xyz
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: https://data.forgejo.org/docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .forgejo/ci
|
||||||
|
file: .forgejo/ci/Dockerfile
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: forge.lvl0.xyz/lvl0/rater-ci:latest
|
||||||
|
|
@ -28,19 +28,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
# Debugging cache miss issue (#16) — check whether ACTIONS_CACHE_URL is injected and reachable
|
|
||||||
- name: Debug cache env
|
|
||||||
run: |
|
|
||||||
echo "ACTIONS_CACHE_URL=${ACTIONS_CACHE_URL}"
|
|
||||||
env | grep -i cache || true
|
|
||||||
curl -v --max-time 5 "${ACTIONS_CACHE_URL}" || echo "CURL FAILED: $?"
|
|
||||||
|
|
||||||
- name: Cache PHP installation
|
|
||||||
uses: https://data.forgejo.org/actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /usr/local/php
|
|
||||||
key: php-8.4-pdo_pgsql-mbstring-xml-dom-intl-pcov
|
|
||||||
|
|
||||||
- name: Set up PHP
|
- name: Set up PHP
|
||||||
uses: https://github.com/shivammathur/setup-php@v2
|
uses: https://github.com/shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -48,25 +35,6 @@ jobs:
|
||||||
extensions: pdo_pgsql, mbstring, xml, dom, intl
|
extensions: pdo_pgsql, mbstring, xml, dom, intl
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
|
|
||||||
# Debugging cache miss issue (#16) — check if /usr/local/php exists after setup-php
|
|
||||||
- name: Debug PHP install path
|
|
||||||
run: |
|
|
||||||
ls -la /usr/local/php 2>&1 || echo "/usr/local/php does not exist"
|
|
||||||
which php
|
|
||||||
php -v
|
|
||||||
|
|
||||||
# Debugging cache miss issue (#16) — ACTIONS_STEP_DEBUG enabled to inspect save/restore
|
|
||||||
- name: Cache Composer dependencies
|
|
||||||
uses: https://data.forgejo.org/actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.composer/cache
|
|
||||||
key: composer-${{ hashFiles('composer.lock') }}
|
|
||||||
restore-keys: composer-
|
|
||||||
|
|
||||||
# Debugging cache miss issue (#16) — check if ~/.composer/cache exists before/after install
|
|
||||||
- name: Debug composer cache path (before install)
|
|
||||||
run: ls -la ~/.composer/cache 2>&1 || echo "~/.composer/cache does not exist yet"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --no-interaction --prefer-dist
|
run: composer install --no-interaction --prefer-dist
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue