-
-
Notifications
You must be signed in to change notification settings - Fork 60
54 lines (43 loc) · 1.72 KB
/
build-phar.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
name: Build PHARs
on:
# Run on pushes to master and on all pull requests.
# Prevent the build from running when there are only irrelevant changes.
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Deliberately missing PHP 8.0 as that PHAR is build and used in the test workflow.
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4']
name: "Build Phar on PHP: ${{ matrix.php }}"
continue-on-error: ${{ matrix.php == '8.4' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On
- name: Build the phars
run: php scripts/build-phar.php
# Both the below only check a file which is rarely changed and therefore unlikely to have issues.
# This test is about testing that the phars are functional, *not* about whether the code style complies.
- name: 'PHPCS: check code style using the Phar file to test the Phar is functional'
run: php phpcs.phar ./scripts
- name: 'PHPCBF: fix code style using the Phar file to test the Phar is functional'
run: php phpcbf.phar ./scripts