-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (102 loc) · 3.58 KB
/
grumphp.yml
File metadata and controls
104 lines (102 loc) · 3.58 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Run GrumPHP
on:
workflow_call:
inputs:
php-versions:
description: The PHP versions to run on
required: false
type: string
default: "['8.3', '8.4']"
operating-systems:
description: The operating systems to run on
required: false
type: string
default: "['ubuntu-latest']"
composer-versions:
description: The composer versions to run on
required: false
type: string
default: "['composer:v2']"
tasks:
description: The grumphp tasks to run
required: false
type: string
default: ''
coverage-report:
description: Should the coverage report, when available, be added to the Pull Request as a comment
required: false
type: boolean
default: false
before-install:
description: Script to run before running composer install
required: false
type: string
default: ''
before-test:
description: Script to run before running the test
required: false
type: string
default: ''
simpletest_db:
description: Drupal test database connection string
required: false
type: string
default: 'sqlite://localhost/:memory:'
secrets:
GH_TOKEN:
required: false
jobs:
grumphp:
strategy:
matrix:
operating-system: ${{ fromJson(inputs.operating-systems) }}
php-versions: ${{ fromJson(inputs.php-versions) }}
composer-versions: ${{ fromJson(inputs.composer-versions) }}
fail-fast: false
runs-on: ${{ matrix.operating-system }}
name: PHP ${{ matrix.php-versions }} with ${{ matrix.composer-versions }} on ${{ matrix.operating-system }}
env:
SIMPLETEST_DB: ${{ inputs.simpletest_db }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: ${{ matrix.composer-versions }}
extensions: xdebug, mbstring, posix, :redis
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Set Github secret for composer
if: env.GH_TOKEN
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
composer config --global github-oauth.github.com ${{ secrets.GH_TOKEN }}
- name: Run before install commands
if: ${{ inputs.before-install != '' }}
run: ${{ inputs.before-install }}
- name: Install dependencies
run: |
composer install --no-progress --no-suggest --no-scripts
- name: Run before test commands
if: ${{ inputs.before-test != '' }}
run: ${{ inputs.before-test }}
- name: Run the tests
run: php vendor/bin/grumphp run --no-interaction --tasks='${{ inputs.tasks }}'
# Add comment to PR with the code coverage report.
- name: Coverage Report as Comment (Clover)
if: ${{ github.event_name == 'pull_request' && inputs.coverage-report && hashFiles('build/logs/clover.xml') != '' }}
uses: lucassabreu/comment-coverage-clover@main
with:
file: build/logs/clover.xml
with-chart: false
table-below-coverage: 99.99