limit CI PHP versions #2
This file contains hidden or 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: CI Release | |
| on: | |
| push: | |
| branches: | |
| - 'rel_*' | |
| - 'main' | |
| - 'master' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['7.4', '8.0'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer | |
| - run: composer install --no-interaction --prefer-dist | |
| - name: PHP Syntax Check | |
| run: find src Tests -name "*.php" -print0 | xargs -0 -n1 php -l | |
| - name: PHPUnit | |
| run: vendor/bin/phpunit --fail-on-risky --fail-on-warning | |
| - name: Report SUCCESS to Gitea | |
| if: success() | |
| run: | | |
| curl -X POST \ | |
| -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "state": "success", | |
| "context": "ci/github", | |
| "description": "CI passed on GitHub", | |
| "target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'" | |
| }' \ | |
| ${{ vars.GITEA_API }}statuses/${{ github.sha }} | |
| - name: Report FAILURE to Gitea | |
| if: failure() | |
| run: | | |
| curl -X POST \ | |
| -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "state": "failure", | |
| "context": "ci/github", | |
| "description": "CI failed on GitHub", | |
| "target_url": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'" | |
| }' \ | |
| ${{ vars.GITEA_API }}statuses/${{ github.sha }} |