Skip to content

Commit 1967567

Browse files
committed
use CI composite actions
1 parent d70eab1 commit 1967567

1 file changed

Lines changed: 16 additions & 41 deletions

File tree

.github/workflows/ci-release.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- 'master'
99

1010
jobs:
11-
test:
11+
package-tests:
1212
runs-on: ubuntu-latest
1313

1414
strategy:
@@ -29,48 +29,23 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131

32-
- uses: shivammathur/setup-php@v2
32+
- name: Run package tests
33+
uses: d3datadevelopment/ci-actions/composer-package-test@v1
3334
with:
34-
php-version: ${{ matrix.php-version }}
35-
tools: composer
35+
php_version: ${{ matrix.php-version }}
36+
syntax_check_paths: "src,Tests"
37+
test_suites: "linkmobility"
3638

37-
- run: composer install --no-interaction --prefer-dist
38-
39-
- name: PHP Syntax Check
40-
run: find src Tests -name "*.php" -print0 | xargs -0 -n1 php -l
41-
42-
- name: run unit tests
43-
run: vendor/bin/phpunit --fail-on-risky --fail-on-warning --no-coverage --testsuite linkmobility
44-
45-
report-to-gitea:
39+
report-status:
4640
runs-on: ubuntu-latest
47-
needs: test
41+
needs: package-tests
4842
if: always()
4943
steps:
50-
- name: Report SUCCESS to Gitea
51-
if: needs.test.result == 'success'
52-
run: |
53-
curl -X POST \
54-
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
55-
-H "Content-Type: application/json" \
56-
-d '{
57-
"state": "success",
58-
"context": "ci/github",
59-
"description": "CI passed (all matrix jobs)",
60-
"target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
61-
}' \
62-
${{ vars.GITEA_API }}statuses/${{ github.sha }}
63-
64-
- name: Report FAILURE to Gitea
65-
if: needs.test.result != 'success'
66-
run: |
67-
curl -X POST \
68-
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
69-
-H "Content-Type: application/json" \
70-
-d '{
71-
"state": "failure",
72-
"context": "ci/github",
73-
"description": "CI failed (one or more matrix jobs)",
74-
"target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'"
75-
}' \
76-
${{ vars.GITEA_API }}statuses/${{ github.sha }}
44+
- name: Report CI status
45+
uses: d3datadevelopment/ci-actions/status-reporter@v1
46+
with:
47+
api_status_endpoint: "${{ vars.GITEA_API }}${{ github.sha }}"
48+
auth_token: ${{ secrets.GITEA_TOKEN }}
49+
state: ${{ needs.package-tests.result }}
50+
description: "CI result: ${{ needs.package-tests.result }}"
51+
target_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 commit comments

Comments
 (0)