Skip to content

Commit 63374a5

Browse files
committed
build: add unit test actions
1 parent eac0cfa commit 63374a5

2 files changed

Lines changed: 40 additions & 4 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+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Cache Composer packages
22+
id: composer-cache
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"homepage": "https://wazabii.se"
2828
}
2929
],
30+
"scripts": {
31+
"test": "php vendor/bin/unitary"
32+
},
3033
"require": {
3134
"php": ">=8.2",
3235
"psr/http-message": "^2.0",
@@ -44,11 +47,10 @@
4447
},
4548
"extra": {
4649
"branch-alias": {
47-
"dev-develop": "2.0.x-dev"
50+
"dev-main": "2.x-dev",
51+
"dev-develop": "2.x-dev"
4852
}
4953
},
5054
"minimum-stability": "dev",
51-
"scripts": {
52-
"unitary": "php vendor/bin/unitary"
53-
}
55+
"prefer-stable": true
5456
}

0 commit comments

Comments
 (0)