Skip to content

Commit 503dd93

Browse files
committed
improve CI pipeline
test selected combinations transfer summarized status to Gitea
1 parent cb6563e commit 503dd93

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/ci-release.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2']
17+
include:
18+
# min
19+
- php-version: "7.3"
20+
21+
# 8.x
22+
- php-version: "8.0"
23+
24+
# max
25+
- php-version: "8.2"
1826

1927
name: PHP ${{ matrix.php-version }} tests
2028

@@ -35,30 +43,35 @@ jobs:
3543
- name: PHPUnit
3644
run: vendor/bin/phpunit --fail-on-risky --fail-on-warning
3745

46+
report-to-gitea:
47+
runs-on: ubuntu-latest
48+
needs: test
49+
if: always()
50+
steps:
3851
- name: Report SUCCESS to Gitea
39-
if: success()
52+
if: needs.test.result == 'success'
4053
run: |
4154
curl -X POST \
4255
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
4356
-H "Content-Type: application/json" \
4457
-d '{
4558
"state": "success",
4659
"context": "ci/github",
47-
"description": "CI passed on GitHub",
60+
"description": "CI passed (all matrix jobs)",
4861
"target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
4962
}' \
5063
${{ vars.GITEA_API }}statuses/${{ github.sha }}
5164
5265
- name: Report FAILURE to Gitea
53-
if: failure()
66+
if: needs.test.result != 'success'
5467
run: |
5568
curl -X POST \
5669
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
5770
-H "Content-Type: application/json" \
5871
-d '{
5972
"state": "failure",
6073
"context": "ci/github",
61-
"description": "CI failed on GitHub",
74+
"description": "CI failed (one or more matrix jobs)",
6275
"target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
6376
}' \
6477
${{ vars.GITEA_API }}statuses/${{ github.sha }}

0 commit comments

Comments
 (0)