forked from scssphp/scssphp
-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (85 loc) · 3.52 KB
/
ci.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
push:
branches: [ master, '[1-9]+.x' ]
pull_request:
jobs:
tests:
name: "Tests on PHP ${{ matrix.php }}${{ matrix.name_suffix }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
extensions: [ '' ]
os: [ubuntu-latest]
include:
- php: '8.1'
os: ubuntu-latest
extensions: ':mbstring'
name_suffix: ' without mbstring'
- php: '8.1'
os: windows-latest
name_suffix: ' on Windows'
- php: '8.1'
os: macos-latest
name_suffix: ' on macOS'
steps:
- if: ${{ runner.os == 'Windows' }}
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php }}"
extensions: "${{ matrix.extensions }}"
ini-file: development
# PHPUnit 8.5.18+ and 9.5.7+ contains a runtime check for ext-mbstring, so we need to use an older version
# for running tests without ext-mbstring.
- name: Force the PHPUnit version
if: ${{ matrix.extensions == ':mbstring' }}
run: composer require --dev --no-update phpunit/phpunit 9.5.6
- name: Install dependencies
# PHPUnit requires ext-mbstring. But it is only necessary for features that we don't currently use:
# - the testdox, JUnit and XML result printers
# - the StringContains assertion when ignoring case
# Ignoring the requirement is necessary for the job running the testsuite without mbstring
run: composer update --ansi --no-progress --ignore-platform-req=ext-mbstring --ignore-platform-req=php+
- name: Run tests
run: vendor/bin/phpunit --colors=always
static_analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "8.2"
ini-file: development
- name: Install dependencies
run: composer update --ansi --no-progress
- name: Install phpstan
run: composer bin phpstan update --ansi --no-progress
- name: Run phpstan
run: vendor-bin/phpstan/vendor/bin/phpstan analyse --ansi --no-progress
coding_styles:
name: Coding styles
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "8.2"
ini-file: development
- name: Install dependencies
run: composer update --ansi --no-progress
- name: Run phpcs
run: vendor/bin/phpcs --extensions=php bin src tests *.php