Fix pipeline issues #7
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: "Tests" | |
on: | |
- push | |
- pull_request | |
jobs: | |
coding-standard: | |
name: Coding standards | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
coverage: none | |
tools: cs2pr | |
# Install dependencies and handle caching in one go. | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
# Bust the cache at least once a month - output format: YYYY-MM. | |
custom-cache-suffix: $(date -u "+%Y-%m") | |
- name: Check coding standards | |
id: phpcs | |
run: ./vendor/bin/phpcs -s --report-full --report-checkstyle=./phpcs-report.xml | |
- name: Show PHPCS results in PR | |
if: ${{ always() && steps.phpcs.outcome == 'failure' }} | |
run: cs2pr ./phpcs-report.xml | |
type-checker: | |
name: Type checker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Psalm | |
uses: docker://vimeo/psalm-github-actions | |
with: | |
args: --shepherd | |
unit-tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Install dependencies and handle caching in one go. | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
# Bust the cache at least once a month - output format: YYYY-MM. | |
custom-cache-suffix: $(date -u "+%Y-%m") | |
- name: Import GPG key | |
run: gpg --import tests/private.key | |
- name: Unit tests | |
uses: php-actions/phpunit@v3 | |
with: | |
version: '10.5' | |
php_version: '8.1' | |
php_extensions: gnupg xdebug | |
coverage_clover: ./coverage.xml | |
env: | |
XDEBUG_MODE: coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml |