|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +jobs: |
| 8 | + |
| 9 | + yml-lint: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + name: 'YML lint' |
| 12 | + timeout-minutes: 3 |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - run: docker pull cytopia/yamllint |
| 16 | + - run: docker run --rm -t -v $(pwd):/data cytopia/yamllint --config-file=tests/.yamllint . |
| 17 | + |
| 18 | + markdown-lint: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + name: 'Markdown lint' |
| 21 | + timeout-minutes: 3 |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - run: docker pull tmknom/markdownlint |
| 25 | + - run: docker run --rm -v $(pwd):/work tmknom/markdownlint '**/*.md' --config tests/.markdownlintrc --ignore vendor --ignore CHANGELOG.md --ignore var --ignore tmp |
| 26 | + |
| 27 | + cs-lint: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + name: 'CS Lint' |
| 30 | + timeout-minutes: 5 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - uses: shivammathur/setup-php@v2 |
| 34 | + with: |
| 35 | + php-version: '8.4' |
| 36 | + tools: composer:v2 |
| 37 | + - run: composer install --dev --ignore-platform-req=php --quiet |
| 38 | + shell: bash |
| 39 | + - run: PHP_CS_FIXER_IGNORE_ENV=1 composer cs:list |
| 40 | + shell: bash |
| 41 | + |
| 42 | + psalm: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + name: 'Psalm' |
| 45 | + timeout-minutes: 5 |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - uses: shivammathur/setup-php@v2 |
| 49 | + with: |
| 50 | + php-version: '8.4' |
| 51 | + tools: composer:v2 |
| 52 | + - run: composer install --ignore-platform-req=php --quiet |
| 53 | + shell: bash |
| 54 | + - run: composer psalm |
| 55 | + shell: bash |
| 56 | + |
| 57 | + phpstan: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + name: 'Phpstan' |
| 60 | + timeout-minutes: 5 |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: shivammathur/setup-php@v2 |
| 64 | + with: |
| 65 | + php-version: '8.4' |
| 66 | + tools: composer:v2 |
| 67 | + - run: composer install --ignore-platform-req=php --quiet |
| 68 | + shell: bash |
| 69 | + - run: composer phpstan |
| 70 | + shell: bash |
| 71 | + |
| 72 | + test-unit: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + name: "Running unit tests for PHP ${{ matrix.php-version }}" |
| 75 | + strategy: |
| 76 | + fail-fast: false |
| 77 | + matrix: |
| 78 | + php-version: ['8.2', '8.3', '8.4'] |
| 79 | + timeout-minutes: 5 |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + - uses: shivammathur/setup-php@v2 |
| 83 | + with: |
| 84 | + php-version: ${{ matrix.php-version }} |
| 85 | + tools: composer:v2 |
| 86 | + - run: composer install --ignore-platform-req=php --quiet |
| 87 | + shell: bash |
| 88 | + - run: composer test |
| 89 | + shell: bash |
| 90 | + |
| 91 | + test-unit-coverage: |
| 92 | + runs-on: ubuntu-latest |
| 93 | + name: "Running unit test coverage" |
| 94 | + timeout-minutes: 5 |
| 95 | + needs: |
| 96 | + - test-unit |
| 97 | + steps: |
| 98 | + - uses: actions/checkout@v4 |
| 99 | + - uses: shivammathur/setup-php@v2 |
| 100 | + with: |
| 101 | + php-version: '8.4' |
| 102 | + tools: composer:v2 |
| 103 | + - run: composer install --ignore-platform-req=php --quiet |
| 104 | + shell: bash |
| 105 | + - run: composer test:coverage:xml |
| 106 | + shell: bash |
| 107 | + - uses: paambaati/[email protected] |
| 108 | + env: |
| 109 | + CC_TEST_REPORTER_ID: 203d856fbc3ebebe66cc94cccde4429973298c7fb919df64a1557850cc9c8345 |
| 110 | + with: |
| 111 | + coverageLocations: coverage.xml:clover |
| 112 | + - uses: actions/upload-artifact@v4 |
| 113 | + with: |
| 114 | + name: coverage.xml |
| 115 | + path: coverage.xml |
| 116 | + |
| 117 | + test-mutant: |
| 118 | + runs-on: ubuntu-latest |
| 119 | + name: 'Mutant Test' |
| 120 | + timeout-minutes: 5 |
| 121 | + continue-on-error: true |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v4 |
| 124 | + - uses: shivammathur/setup-php@v2 |
| 125 | + with: |
| 126 | + php-version: '8.4' |
| 127 | + tools: composer:v2 |
| 128 | + - run: composer install --ignore-platform-req=php --quiet |
| 129 | + shell: bash |
| 130 | + - run: composer test:mutant |
| 131 | + shell: bash |
0 commit comments