Skip to content

Commit 3e8c4de

Browse files
Add check
1 parent 3129e8e commit 3e8c4de

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed

.github/actions/setup/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup PHP
2+
description: Setup PHP environment, cache dependencies, and install dependencies
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Checkout Code
7+
uses: actions/checkout@v3
8+
9+
- name: Set up PHP
10+
uses: shivammathur/setup-php@v2
11+
with:
12+
php-version: ${{ inputs.php }}
13+
tools: composer
14+
15+
- name: Cache Composer Dependencies
16+
uses: actions/cache@v3
17+
with:
18+
path: vendor
19+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-composer-
22+
23+
- name: Install Dependencies
24+
run: composer install --prefer-dist --no-progress --no-suggest
25+
26+
inputs:
27+
php:
28+
description: PHP version
29+
required: true

.github/workflows/unit-tests.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit Tests
1+
name: Check and Test
22

33
on:
44
push:
@@ -9,12 +9,33 @@ on:
99
- '**'
1010

1111
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
strategy:
16+
matrix:
17+
php: ['7.4', '8.1']
18+
steps:
19+
- name: Setup
20+
uses: ./.github/actions/setup
21+
with:
22+
php: ${{ matrix.php }}
23+
24+
- name: PHPCS
25+
run: ./bin/check-style
26+
1227
test:
28+
needs: check
1329
runs-on: ubuntu-latest
1430
timeout-minutes: 10
31+
strategy:
32+
matrix:
33+
php: ['7.4', '8.1']
1534
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
35+
- name: Setup
36+
uses: ./.github/actions/setup
37+
with:
38+
php: ${{ matrix.php }}
1839

19-
- name: PHPUnit tests
20-
uses: php-actions/phpunit@v3
40+
- name: PHPUnit
41+
run: ./bin/unit-tests

0 commit comments

Comments
 (0)