-
Notifications
You must be signed in to change notification settings - Fork 22
83 lines (81 loc) · 2.32 KB
/
php.yml
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
name: PHP
on:
push:
branches: [ main ]
tags:
- "php/v**"
paths:
- '.github/workflows/php.yml'
- 'php/**'
- 'test-resources/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/php.yml'
- 'php/**'
- 'test-resources/**'
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "php"
strategy:
matrix:
dependencies:
- "lowest"
- "highest"
php-version:
- "8.1"
- "8.2"
- "8.3"
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
env:
update: true
- name: "Cache dependencies"
uses: "actions/cache@v4.2.0"
with:
path: |
~/.composer/cache
php/vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"
- name: "PHPStan"
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=-1"
- name: "Tests"
run: "vendor/bin/pest"
sync:
runs-on: ubuntu-latest
name: Sync changes to the read-only repository
needs: test
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Remove "php/" from tag name
id: tag-replacer
run: |
TAG=${GITHUB_REF//tags\/php\//tags\/}
echo "::set-output name=NEW_TAG::$TAG"
- uses: stefandanaita/git-subtree-action@1.2.0
with:
repo: "truelayer/truelayer-signing-php"
path: "php"
deploy_key: ${{ secrets.DOWNSTREAM_GITHUB_DEPLOY_KEY }}
branch: ${{ steps.tag-replacer.outputs.NEW_TAG }}
force: true