Skip to content

Commit c020cc9

Browse files
authored
Merge pull request #32 from LiquidCats/actions
[FEATURE] Add GH action with tests
2 parents 6007822 + 097cca2 commit c020cc9

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/tests.yml

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

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"laravel/framework": ">=v7.0.0|>=v10.0.0",
1515
"spomky-labs/cbor-php": "^3.0"
1616
},
17+
"scripts": {
18+
"test": "@php vendor/bin/phpunit"
19+
},
1720
"require-dev": {
1821
"phpunit/phpunit": "~8.0"
1922
},

0 commit comments

Comments
 (0)