Skip to content

Commit 6fba6f6

Browse files
committed
Fix workflow
1 parent 0dd5443 commit 6fba6f6

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
name: CI
22

3-
on: [push]
3+
on: [push,pull_request]
4+
5+
permissions:
6+
contents: read
47

58
jobs:
6-
build-test:
9+
build:
710
runs-on: ubuntu-latest
811

912
steps:
10-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1114

12-
- uses: php-actions/composer@v5
15+
- name: Validate composer.json and composer.lock
16+
run: composer validate --strict
1317

14-
- name: PHPUnit Tests
15-
uses: php-actions/phpunit@v2
18+
- name: Cache Composer packages
19+
id: composer-cache
20+
uses: actions/cache@v3
1621
with:
17-
bootstrap: vendor/autoload.php
18-
configuration: test/phpunit.xml
19-
args: --coverage-text
22+
path: vendor
23+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-php-
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress
29+
30+
- name: Run test suite
31+
run: composer run-script test

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
"psr-4": {
2727
"YOCLIB\\OpenLocationCode\\Tests\\": "tests/"
2828
}
29+
},
30+
"scripts": {
31+
"test": "phpunit"
2932
}
3033
}

0 commit comments

Comments
 (0)