Skip to content

Commit 28b252e

Browse files
committed
Added test action.
1 parent 4297da9 commit 28b252e

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: ['8.2', '8.3', '8.4']
17+
18+
name: PHP ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v5
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: mbstring, json, curl
29+
coverage: none
30+
31+
- name: Install dependencies
32+
run: composer update --prefer-dist --no-interaction --no-progress
33+
34+
- name: Check code style
35+
run: vendor/bin/pint --test
36+
37+
- name: Run static analysis
38+
run: vendor/bin/phpstan analyse
39+
40+
- name: Run tests
41+
run: vendor/bin/phpunit

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![License](https://img.shields.io/packagist/l/pralhadstha/zipcoder-php.svg?style=flat-square)](LICENSE)
88
[![Total Downloads](https://img.shields.io/packagist/dt/pralhadstha/zipcoder-php.svg?style=flat-square)](https://packagist.org/packages/pralhadstha/zipcoder-php)
99
[![PHPStan Level 9](https://img.shields.io/badge/PHPStan-level%209-brightgreen.svg?style=flat-square)](https://phpstan.org/)
10+
[![Tests](https://img.shields.io/github/actions/workflow/status/pralhadstha/zipcoder-php/tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/pralhadstha/zipcoder-php/actions)
1011

1112
---
1213

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
"Pralhad\\Zipcoder\\Tests\\": "tests/"
3939
}
4040
},
41+
"scripts": {
42+
"test": "vendor/bin/phpunit",
43+
"analyse": "vendor/bin/phpstan analyse",
44+
"format": "vendor/bin/pint",
45+
"check-style": "vendor/bin/pint --test"
46+
},
4147
"minimum-stability": "stable",
4248
"prefer-stable": true
4349
}

0 commit comments

Comments
 (0)