Skip to content

Commit 1f633e7

Browse files
committed
refactor github actions workflow #9
1 parent 66817db commit 1f633e7

File tree

2 files changed

+47
-56
lines changed

2 files changed

+47
-56
lines changed

.github/workflows/main.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "CI"
2+
# Controls when the action will run.
3+
on:
4+
# Triggers the workflow on push or pull request events but only for the main branch
5+
push:
6+
pull_request:
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: "read"
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# composer validation
17+
composer:
18+
name: "composer config validation"
19+
runs-on: "ubuntu-latest"
20+
steps:
21+
- uses: "actions/checkout@v3"
22+
- name: "Validate composer.json"
23+
run: "composer validate --strict"
24+
# PHP lint and PHPStan for different PHP versions
25+
php:
26+
runs-on: "ubuntu-latest"
27+
strategy:
28+
matrix:
29+
php-version:
30+
- "8.1"
31+
- "8.2"
32+
- "8.3"
33+
name: "PHP ${{ matrix.php-version }}"
34+
steps:
35+
- name: "git checkout"
36+
uses: "actions/checkout@v3"
37+
- name: "setup PHP"
38+
uses: "shivammathur/setup-php@v2"
39+
with:
40+
php-version: "${{ matrix.php-version }}"
41+
coverage: "xdebug"
42+
- name: "check PHP version"
43+
run: "php -v"
44+
- name: "lint PHP files"
45+
run: "php -l src/ tests/"
46+
- name: "install composer dependencies"
47+
run: "composer install --prefer-dist --no-progress"

.github/workflows/php.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)