File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI Release
2+
3+ on :
4+ push :
5+ branches :
6+ - ' rel_*'
7+ - ' main'
8+ - ' master'
9+
10+ jobs :
11+ test :
12+ runs-on : ubuntu-latest
13+
14+ strategy :
15+ fail-fast : false
16+ matrix :
17+ php-version : ['8.1', '8.2']
18+
19+ steps :
20+ - uses : actions/checkout@v4
21+
22+ - uses : shivammathur/setup-php@v2
23+ with :
24+ php-version : ${{ matrix.php-version }}
25+ tools : composer
26+
27+ - run : composer install --no-interaction --prefer-dist
28+
29+ - name : PHP Syntax Check
30+ run : find src tests -name "*.php" -print0 | xargs -0 -n1 php -l
31+
32+
33+ - name : PHPUnit
34+ run : vendor/bin/phpunit --fail-on-risky --fail-on-warning
35+
36+ - name : Report SUCCESS to Gitea
37+ if : success()
38+ run : |
39+ curl -X POST \
40+ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
41+ -H "Content-Type: application/json" \
42+ -d '{
43+ "state": "success",
44+ "context": "ci/github",
45+ "description": "CI passed on GitHub",
46+ "target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
47+ }' \
48+ ${{ vars.GITEA_API }}statuses/${{ github.sha }}
49+
50+ - name : Report FAILURE to Gitea
51+ if : failure()
52+ run : |
53+ curl -X POST \
54+ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
55+ -H "Content-Type: application/json" \
56+ -d '{
57+ "state": "failure",
58+ "context": "ci/github",
59+ "description": "CI failed on GitHub",
60+ "target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
61+ }' \
62+ ${{ vars.GITEA_API }}statuses/${{ github.sha }}
You can’t perform that action at this time.
0 commit comments