Skip to content

Commit 0f575f1

Browse files
authoredJul 30, 2023
[ Feat ] Add type-coverage pest plugin (#34)
* add type-coverage pest plugin * add composer script, check types in CI
1 parent 07a4a12 commit 0f575f1

File tree

3 files changed

+393
-127
lines changed

3 files changed

+393
-127
lines changed
 

‎.github/workflows/types.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Types
2+
on:
3+
- push
4+
jobs:
5+
test:
6+
strategy:
7+
matrix:
8+
operating-system:
9+
- ubuntu-latest
10+
php-version:
11+
- "8.2"
12+
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
13+
runs-on: ${{ matrix.operating-system }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php-version }}
21+
extensions: bcmath, ctype, fileinfo, json, mbstring, openssl, pdo, tokenizer, xml
22+
coverage: none
23+
- name: Get composer cache directory
24+
id: composer-cache
25+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
- name: Setup composer cache
27+
uses: actions/cache@v2
28+
with:
29+
path: ${{ steps.composer-cache.outputs.dir }}
30+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
31+
restore-keys: ${{ runner.os }}-composer-
32+
- name: Install composer dependencies
33+
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
34+
- name: Get type coverage
35+
run: composer types

‎composer.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"mockery/mockery": "^1.5.1",
3333
"nunomaduro/larastan": "^2.0",
3434
"nunomaduro/termwind": "^1.15.1",
35-
"pestphp/pest": "^2.5"
35+
"pestphp/pest": "^2.5",
36+
"pestphp/pest-plugin-type-coverage": "^2.0"
3637
},
3738
"autoload": {
3839
"psr-4": {
@@ -64,6 +65,9 @@
6465
],
6566
"test": [
6667
"@php whisky test"
68+
],
69+
"types": [
70+
"vendor/bin/pest --type-coverage --min=88"
6771
]
6872
},
6973
"minimum-stability": "stable",

0 commit comments

Comments
 (0)