Skip to content

Commit 172e241

Browse files
Adding GH Action for tests
Signed-off-by: Dusan Malusev <[email protected]>
1 parent 7c3c3d9 commit 172e241

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/test.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Run Tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
XDEBUG_MODE: "coverage"
13+
GITHUB_WORKSPACE: /var/www/html
14+
15+
jobs:
16+
testing:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
operating-system: ['ubuntu-latest']
21+
php-versions: ['8.1', '8.2', '8.3']
22+
phpts: [true, false]
23+
env:
24+
extensions: mbstring, intl, sodium, xsl, zip, pdo, pdo_sqlite, xdebug, curl
25+
key: extensions-cache
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Cache Vendor
32+
uses: actions/cache@v3
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
36+
37+
- name: Setup cache environment
38+
id: extcache
39+
uses: shivammathur/cache-extensions@v1
40+
with:
41+
php-version: ${{ matrix.php-versions }}
42+
extensions: ${{ env.extensions }}
43+
key: ${{ env.key }}
44+
45+
- name: Cache extensions
46+
uses: actions/cache@v3
47+
with:
48+
path: ${{ steps.extcache.outputs.dir }}
49+
key: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}
50+
restore-keys: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}
51+
52+
- name: Setup PHP
53+
id: setup-php
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: ${{ matrix.php-versions }}
57+
phpts: ${{ matrix.phpts }}
58+
extensions: ${{ env.extensions }}
59+
tools: php-cs-fixer, phpcs, composer
60+
update: true
61+
coverage: xdebug
62+
63+
- name: Composer install
64+
run: composer install -q --no-ansi --prefer-dist --no-interaction --no-progress
65+
66+
- name: Run Tests
67+
run: vendor/bin/pest --coverage-clover=coverage.xml --coverage --colors always --fail-on-risky --fail-on-warning --fail-on-deprecation --strict-coverage
68+
69+
- uses: codecov/codecov-action@v3
70+
with:
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
file: ./coverage.xml
73+
flags: tests
74+
name: laravel-crypto
75+
fail_ci_if_error: true
76+
verbose: false

0 commit comments

Comments
 (0)