Skip to content

Commit 62f0112

Browse files
authored
Merge pull request #46 from BoatraceOpenAPI/feature/add-test-workflow
ci: add test workflow
2 parents c8168a7 + 086b78e commit 62f0112

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'gh-pages'
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
name: PHPUnit ${{ matrix.phpunit-version }} on PHP ${{ matrix.php-version }} (Ubuntu 24.04)
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
contents: read
18+
id-token: write
19+
strategy:
20+
matrix:
21+
php-version:
22+
- '8.4'
23+
phpunit-version:
24+
- '12.0'
25+
steps:
26+
- name: Setup PHP ${{ matrix.php-version }}
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php-version }}
30+
coverage: pcov
31+
32+
- name: Checkout Repository
33+
uses: actions/checkout@v4
34+
35+
- name: Require PHPUnit ${{ matrix.phpunit-version }}
36+
run: composer require --dev phpunit/phpunit:^${{ matrix.phpunit-version }} --with-all-dependencies
37+
38+
- name: Install Dependencies
39+
run: composer update --prefer-dist --no-interaction --no-progress
40+
41+
- name: Run PHPUnit ${{ matrix.phpunit-version }}
42+
run: vendor/bin/phpunit --coverage-xml=build/coverage-xml

phpunit.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
cacheDirectory=".phpunit.cache"
4+
colors="true"
5+
processIsolation="false"
6+
stopOnFailure="false">
7+
8+
<testsuites>
9+
<testsuite name="Boatrace Open API">
10+
<directory suffix="Test.php">tests/</directory>
11+
</testsuite>
12+
</testsuites>
13+
14+
<source>
15+
<include>
16+
<directory>src/</directory>
17+
</include>
18+
</source>
19+
20+
<coverage>
21+
<report>
22+
<clover outputFile="build/coverage-xml/coverage.xml"/>
23+
</report>
24+
</coverage>
25+
</phpunit>

0 commit comments

Comments
 (0)