Repository navigation
89 lines (75 loc) · 2.16 KB
/
Copy pathtests.yml
File metadata and controls
89 lines (75 loc) · 2.16 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
name: Tests
on:
push:
branches:
- master
- '*.x'
pull_request:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
php: ${{ steps.changed-files.outputs.any_modified }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
files: |
bin/**
src/**
tests/**
composer.json
phpunit.xml.dist
.github/workflows/tests.yml
**.php
php-tests:
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
runs-on: ubuntu-latest
needs: [changes]
if: needs.changes.outputs.php == 'true'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
stability: [prefer-lowest, prefer-stable]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: ${{ matrix.php }}
extensions: pdo_sqlite
coverage: none
- name: Install dependencies
env:
STABILITY: ${{ matrix.stability }}
run: composer update --"$STABILITY" --prefer-dist --no-interaction --no-progress
- name: Run tests
run: vendor/bin/phpunit
php-tests-result:
name: PHP tests
runs-on: ubuntu-latest
needs: [changes, php-tests]
if: always()
permissions: {}
steps:
- name: Fail if any job failed
if: needs.changes.result != 'success' || (needs.php-tests.result != 'success' && needs.php-tests.result != 'skipped')
run: exit 1