Skip to content

Commit 5b55cfb

Browse files
committed
Git Hub Actions basic configuration, Composer dependencies adjusted (#105)
1 parent c4b7d1f commit 5b55cfb

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

.github/workflows/php.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PHP Sniff and Unit Test
2+
3+
on:
4+
push:
5+
branches: [ "master", "develop" ]
6+
pull_request:
7+
branches: [ "master", "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php-versions: [ '8.1', '8.2', '8.3' ]
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Install PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-versions }}
24+
- name: Validate composer.json and composer.lock
25+
run: composer validate --strict
26+
- name: Cache Composer packages
27+
id: composer-cache
28+
uses: actions/cache@v3
29+
with:
30+
path: vendor
31+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-php-
34+
- name: Install dependencies
35+
run: composer install --prefer-dist --no-progress
36+
- name: Run sniffs and unit tests
37+
run: composer check

composer.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "exorg/data-coder",
33
"description": "Expansible Universal Data and Data Files Decoder/Encoder.",
4-
"version": "1.0.0",
54
"type": "library",
65
"keywords": [
76
"exorg",
@@ -19,13 +18,13 @@
1918
}
2019
],
2120
"require": {
22-
"php": ">=8.0.0",
23-
"garoevans/php-enum": "*",
24-
"symfony/yaml": "^6.3"
21+
"php": "8.1 - 8.3",
22+
"symfony/yaml": "^6.3",
23+
"garoevans/php-enum": "^1.2"
2524
},
2625
"require-dev": {
27-
"phpunit/phpunit": "*",
28-
"squizlabs/php_codesniffer": "*"
26+
"squizlabs/php_codesniffer": "^3.7",
27+
"phpunit/phpunit": "^10.4"
2928
},
3029
"autoload": {
3130
"psr-4": {

0 commit comments

Comments
 (0)