Files
CFDivePlatform/.gitea/workflows/test.yml
T
a620906209 95a93b2d72
Run Tests / test (pull_request) Failing after 7s
fix(ci): 替換 setup-php 為 Alpine apk 直接安裝 PHP 8.2
shivammathur/setup-php 在 Alpine runner 上需要 sudo 且編譯耗時。
改用 apk add php82 系列套件,速度更快且相容 Alpine 環境。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 00:32:44 +08:00

39 lines
1.0 KiB
YAML

name: Run Tests
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
run: |
apk add --no-cache \
php82 php82-phar php82-mbstring php82-dom php82-fileinfo php82-gd \
php82-pdo php82-pdo_sqlite php82-sqlite3 php82-tokenizer \
php82-xml php82-xmlwriter php82-ctype php82-curl php82-openssl \
php82-json php82-session php82-iconv \
curl unzip
ln -sf /usr/bin/php82 /usr/local/bin/php
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Copy .env
run: cp .env.example .env
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Generate application key
run: php artisan key:generate
- name: Run tests
run: php artisan test