Skip to content
Merged
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
36 changes: 25 additions & 11 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,9 +28,10 @@ jobs:
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: pcntl

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./

- name: Upload build archive for test runners
uses: actions/upload-artifact@v4
Expand All @@ -37,7 +44,7 @@ jobs:
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 +79,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 +94,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 +118,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 +150,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 @@ -160,12 +171,15 @@ jobs:
remove_old_artifacts:
runs-on: ubuntu-latest

permissions:
actions: write

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?name=build-artifact" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
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 ... "
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
/vendor
/test/phpunit/_coverage
.phpunit.result.cache
/example.*
/example.*
test/phpunit/.phpunit.cache
23 changes: 22 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,26 @@
"psr-4": {
"Gt\\Async\\Test\\": "./test/phpunit"
}
}
},

"scripts": {
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
"phpunit:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text",
"phpstan": "vendor/bin/phpstan analyse --level 6 src",
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
"test": [
"@phpunit",
"@phpstan",
"@phpcs",
"@phpmd"
]
},

"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/PhpGt"
}
]
}
Loading
Loading