-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (78 loc) · 2.42 KB
/
test.yml
File metadata and controls
89 lines (78 loc) · 2.42 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
79
80
81
82
83
84
85
86
87
88
89
# CI for php-sdk.
#
# Action pinning policy:
# - First-party actions (actions/*) are pinned to a major tag (e.g. @v4).
# - Third-party actions are pinned to a full commit SHA, with the released
# version recorded in a trailing comment for human review.
name: test
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: ${{ matrix.php }}
extensions: pdo, pdo_sqlite, mbstring, json
coverage: none
tools: composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist
- name: Lint (php-cs-fixer dry-run)
if: hashFiles('.php-cs-fixer.dist.php', '.php-cs-fixer.php') != ''
run: vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Run PHPUnit
run: vendor/bin/phpunit
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-artifacts-php-${{ matrix.php }}
path: |
.phpunit.cache/
build/
coverage.xml
if-no-files-found: ignore
retention-days: 7