-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (65 loc) · 2.47 KB
/
ci.yml
File metadata and controls
78 lines (65 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI
# touching: trigger children sync when workflows change
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP 8.3 • L12 • deps=highest • OS=ubuntu-latest
runs-on: ubuntu-latest
env:
# Throttle parallel HTTP downloads to reduce GitHub codeload 429 rate limit occurrences for all child packages inheriting this workflow.
COMPOSER_MAX_PARALLEL_HTTP: 6
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP (8.3)
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, dom, pdo, sqlite3, pdo_sqlite, fileinfo
coverage: none
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict
- name: Configure GitHub OAuth for Composer (improves API rate limits)
run: composer config -g github-oauth.github.com "${{ secrets.GITHUB_TOKEN }}"
# GITHUB_TOKEN is automatically provided by Actions; using it boosts authenticated quota for metadata requests.
- name: Get Composer cache directory
shell: bash
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer files
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-php83-highest-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-php83-highest-
${{ runner.os }}-composer-php83-
- name: Install dependencies
shell: bash
run: |
set -euo pipefail
echo "Starting composer update with limited parallel HTTP=${COMPOSER_MAX_PARALLEL_HTTP}";
for attempt in 1 2 3; do
if composer update --no-interaction --prefer-dist --no-progress; then
break
fi
echo "Composer update failed (attempt ${attempt}). Retrying after backoff..." >&2
sleep $((attempt*15))
done
echo "Composer dependencies installed.";
- name: Clear testbench cache
run: |
rm -rf vendor/orchestra/testbench-core/laravel/bootstrap/cache/*
rm -rf vendor/orchestra/testbench-core/laravel/database/database.sqlite
- name: Run test suite
run: composer test