Skip to content

Commit 12f9dc5

Browse files
committed
build: add unitary test to actions
1 parent 98dc3e7 commit 12f9dc5

2 files changed

Lines changed: 45 additions & 6 deletions

File tree

.github/workflows/php.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PHP Unitary
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
env:
17+
COMPOSER_ROOT_VERSION: 2.x-dev
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Cache Composer packages
23+
uses: actions/cache@v3
24+
with:
25+
path: vendor
26+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-php-
29+
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-progress
32+
33+
- name: Run test suite
34+
run: php vendor/bin/unitary

composer.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"homepage": "https://wazabii.se"
2929
}
3030
],
31+
"scripts": {
32+
"test": "php vendor/bin/unitary"
33+
},
3134
"require": {
3235
"php": ">=8.2",
3336
"psr/http-server-middleware": "^1.0",
@@ -37,15 +40,17 @@
3740
"require-dev": {
3841
"maplephp/unitary": "^2.0"
3942
},
40-
"extra": {
41-
"branch-alias": {
42-
"dev-main": "1.x-dev"
43-
}
44-
},
4543
"autoload": {
4644
"psr-4": {
4745
"MaplePHP\\Emitron\\": "src"
4846
}
4947
},
50-
"minimum-stability": "dev"
48+
"extra": {
49+
"branch-alias": {
50+
"dev-main": "1.x-dev",
51+
"dev-develop": "1.x-dev"
52+
}
53+
},
54+
"minimum-stability": "dev",
55+
"prefer-stable": true
5156
}

0 commit comments

Comments
 (0)