Skip to content

Commit fb96fd8

Browse files
committed
Run test in CI
1 parent 8a8a96f commit fb96fd8

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/php-tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
- '!main'
8+
- '!develop'
9+
pull_request:
10+
branches:
11+
- main
12+
- develop
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: '8.3'
28+
29+
- name: Check if composer.json exists
30+
id: check_files
31+
uses: andstor/file-existence-action@v1
32+
with:
33+
files: 'composer.json'
34+
35+
- name: Run composer install if composer.json exists
36+
if: steps.check_files.outputs.files_exists == 'true'
37+
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
38+
39+
- name: Set up Node.js version
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: '20.x'
43+
44+
- name: npm install
45+
run: npm install
46+
47+
- name: Run PHPUnit tests
48+
run: ./vendor/bin/phpunit --testdox
49+

0 commit comments

Comments
 (0)