Skip to content

Commit a46a9d7

Browse files
committed
ci: add continuous integration workflow
1 parent 04758f6 commit a46a9d7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'release-please**'
6+
pull_request:
7+
branches-ignore:
8+
- 'release-please**'
9+
10+
jobs:
11+
code-quality:
12+
name: Run code quality checks on PHP 8.0
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.0'
21+
- name: Install dependencies
22+
run: composer update --no-ansi --no-interaction --no-scripts --prefer-dist
23+
- name: Run code quality checks
24+
run: vendor/bin/grumphp run --testsuite=code_quality
25+
php-tests:
26+
name: Run tests on ${{ matrix.php }}${{ matrix.dependency-version != '' && ' (--prefer-lowest)' || '' }}
27+
needs: code-quality
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
dependency-version: ['']
33+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
34+
include:
35+
- dependency-version: '--prefer-lowest'
36+
php: '7.4'
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
- name: Setup PHP ${{ matrix.php }}
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php }}
44+
- name: Remove GrumPHP
45+
run: composer remove --dev phpro/grumphp
46+
- name: Install dependencies
47+
run: composer update ${{ matrix.dependency-version }} --no-ansi --no-interaction --no-scripts --prefer-dist
48+
- name: Run unit tests
49+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)