Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 21 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
name: CI

on: [push]
on:
push:
pull_request:

permissions:
contents: read
actions: read

jobs:
composer:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Cache Composer dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -22,6 +28,7 @@ jobs:
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: pcntl

- name: Archive build
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
Expand All @@ -31,13 +38,14 @@ jobs:
with:
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions
retention-days: 1

phpunit:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

outputs:
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
Expand Down Expand Up @@ -72,7 +80,7 @@ jobs:
needs: [ phpunit ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -87,13 +95,15 @@ jobs:

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

phpstan:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -109,13 +119,15 @@ jobs:
with:
php_version: ${{ matrix.php }}
path: src/
level: 6
memory_limit: 256M

phpmd:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -139,7 +151,7 @@ jobs:
needs: [ composer ]
strategy:
matrix:
php: [ 8.1, 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -156,18 +168,3 @@ jobs:
php_version: ${{ matrix.php }}
path: src/
standard: phpcs.xml

remove_old_artifacts:
runs-on: ubuntu-latest

steps:
- name: Remove old artifacts for prior workflow runs on this repository
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
while read id
do
echo -n "Deleting artifact ID $id ... "
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
done <artifact-id-list.txt
20 changes: 19 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@
"Gt\\Routing\\Test\\": "./test/phpunit"
}
},
"config": {
"platform": {
"php": "8.1.0"
}
},

"scripts": {
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
"phpstan": "vendor/bin/phpstan analyse --level 6 src --memory-limit 256M",
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
"test": [
"@phpunit",
"@phpstan",
"@phpcs",
"@phpmd"
]
},
"keywords": [
"router",
"route",
Expand All @@ -58,7 +76,7 @@
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/PhpGt"
"url": "https://github.com/sponsors/phpgt"
}
]
}
Loading
Loading