Skip to content

Commit 3e48fa0

Browse files
authored
Merge pull request #4 from Aeliot-Tm/ci
Run tests on GitHub CI
2 parents 9a16be7 + c8503d4 commit 3e48fa0

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version:
17+
- '7.4'
18+
- '8.0'
19+
- '8.1'
20+
include:
21+
- php-version: '7.4'
22+
- php-version: '8.0'
23+
- php-version: '8.1'
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Validate composer.json and composer.lock
29+
run: composer validate --strict
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v3
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-php-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist --no-progress
42+
43+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
44+
# Docs: https://getcomposer.org/doc/articles/scripts.md
45+
46+
- name: Run test suite
47+
run: composer run-script test

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
},
2626
"bin": [
2727
"bin/pccb_clover_compare"
28-
]
28+
],
29+
"scripts": {
30+
"test": "vendor/bin/phpunit"
31+
}
2932
}

0 commit comments

Comments
 (0)