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
8 changes: 4 additions & 4 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
analysis:
exclude_paths:
- "example/**"
- "test/**"
exclude_paths:
- ".github/**"
- "example/**"
- "test/**"

20 changes: 2 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions
retention-days: 1

phpunit:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,6 +93,7 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}

phpstan:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -163,21 +165,3 @@ jobs:
php_version: ${{ matrix.php }}
path: src/
standard: phpcs.xml

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" | 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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Define background jobs in standard crontab format and the Cron Runner will execu
<a href="https://app.codacy.com/gh/PhpGt/Cron" target="_blank">
<img src="https://badge.status.php.gt/cron-quality.svg" alt="Code quality" />
</a>
<a href="https://app.codacy.com/gh/PhpGt/Cron" target="_blank">
<a href="https://app.codecov.io/gh/PhpGt/Cron" target="_blank">
<img src="https://badge.status.php.gt/cron-coverage.svg" alt="Code coverage" />
</a>
<a href="https://packagist.org/packages/PhpGt/Cron" target="_blank">
Expand All @@ -35,6 +35,10 @@ Start the Runner: `vendor/bin/cron`.

If you're using [WebEngine](https://php.gt/webengine), the Cron Runner is automatically started for you by running `gt run`.

## Examples

There is an [example](example/README.md) directory with numbered scripts that can be run directly with `php`. Each one embeds its own crontab string so the schedule and output stay together.

# Proudly sponsored by

[JetBrains Open Source sponsorship program](https://www.jetbrains.com/community/opensource/)
Expand Down
17 changes: 15 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

"require": {
"php": ">=8.1",
"phpgt/cli": "1.*",
"dragonmantank/cron-expression": "^2.2"
"phpgt/cli": "1.*"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
Expand All @@ -29,6 +28,20 @@
"bin/cron"
],

"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",
Expand Down
Loading
Loading