Skip to content

Commit 6b6e5f4

Browse files
authored
Merge pull request #1323 from theofidry/ci/tests
2 parents 7a5afa4 + 663fef7 commit 6b6e5f4

File tree

2 files changed

+61
-32
lines changed

2 files changed

+61
-32
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
release:
8+
types: [ created ]
9+
10+
jobs:
11+
unit-tests:
12+
runs-on: ${{ matrix.operating-system }}
13+
strategy:
14+
matrix:
15+
operating-system: [ ubuntu-latest ]
16+
php-versions:
17+
- '7.2'
18+
- '7.3'
19+
- '7.4'
20+
- '8.0'
21+
- '8.1'
22+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-versions }}
32+
extensions: mbstring, intl, zip, xml
33+
coverage: none
34+
35+
- name: Install dependencies
36+
uses: ramsey/composer-install@v2
37+
38+
- name: Update PHPUnit
39+
run: composer update phpunit/phpunit --with-dependencies
40+
41+
- name: Run test suite
42+
run: vendor/bin/phpunit --exclude-group mayignore --coverage-clover build/logs/clover.xml
43+
44+
45+
# This is a "trick", a meta task which does not change, and we can use in
46+
# the protected branch rules as opposed to the tests one above which
47+
# may change regularly.
48+
validate-tests:
49+
name: Tests status
50+
runs-on: ubuntu-latest
51+
needs:
52+
- unit-tests
53+
if: always()
54+
steps:
55+
- name: Successful run
56+
if: ${{ !(contains(needs.*.result, 'failure')) }}
57+
run: exit 0
58+
59+
- name: Failing run
60+
if: ${{ contains(needs.*.result, 'failure') }}
61+
run: exit 1

0 commit comments

Comments
 (0)