Callback url fix (#80) #446
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHPUnit Tests | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Run PHPUnit tests | |
run: vendor/bin/phpunit --testdox --colors=always > phpunit-results.txt | |
- name: Post PHPUnit results as PR comment | |
if: github.event_name == 'pull_request' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const fs = require('fs'); | |
const phpunitOutput = fs.readFileSync('phpunit-results.txt', 'utf8'); | |
const summary = phpunitOutput.split('\n').slice(0, 10).join('\n'); // Get first 10 lines for summary | |
const fullReport = '## PHPUnit Test Results\n\n<details><summary>Click to expand full report</summary>\n\n```\n' + phpunitOutput + '\n```\n</details>'; | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '## PHPUnit Test Summary\n\n```\n' + summary + '\n```\n\n' + fullReport | |
}); |