|
1 |
| -name: "Continuous Integration" |
| 1 | +name: "Tests" |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
|
8 | 8 | paths-ignore:
|
9 | 9 | - 'docs/**'
|
10 | 10 |
|
11 |
| -env: |
12 |
| - COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" |
13 |
| - COVERAGE_FLAGS: "--coverage-text --coverage-clover build/logs/clover.xml" |
14 |
| - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1" |
15 |
| - |
16 | 11 | jobs:
|
17 | 12 | tests:
|
18 |
| - name: PHP ${{ matrix.php-version }} |
| 13 | + name: PHP ${{ matrix.php-version }} - ${{ matrix.composer }} |
19 | 14 | runs-on: ubuntu-latest
|
20 | 15 | strategy:
|
| 16 | + fail-fast: false |
21 | 17 | matrix:
|
22 |
| - php-version: |
23 |
| - - "8.1" |
24 |
| - - "8.2" |
25 |
| - - "8.3" |
26 |
| - - "8.4" |
27 |
| - include: |
28 |
| - - php-version: 8.4 |
29 |
| - coverage: coverage |
| 18 | + php-version: [8.1, 8.2, 8.3, 8.4] |
| 19 | + composer: [highest, lowest] |
| 20 | + |
30 | 21 | steps:
|
31 | 22 | - name: Checkout
|
32 |
| - uses: actions/checkout@v2 |
33 |
| - with: |
34 |
| - fetch-depth: 10 |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
35 | 25 | - name: Setup PHP, with composer and extensions
|
36 | 26 | uses: shivammathur/setup-php@v2
|
37 | 27 | with:
|
38 | 28 | php-version: ${{ matrix.php-version }}
|
39 | 29 | extensions: dom
|
40 | 30 | coverage: xdebug
|
41 |
| - env: |
42 |
| - update: true |
43 |
| - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
44 |
| - - name: Setup Problem Matchers for PHPUnit |
45 |
| - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
46 |
| - - name: Get composer cache directory |
47 |
| - id: composer-cache |
48 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
49 |
| - - name: Cache composer dependencies |
50 |
| - uses: actions/cache@v1 |
51 |
| - with: |
52 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
53 |
| - key: ${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }} |
54 |
| - restore-keys: ${{ matrix.php-version }}-composer- |
55 |
| - - name: Install Composer |
56 |
| - uses: nick-invision/retry@v1 |
| 31 | + tools: composer:v2 |
| 32 | + |
| 33 | + - uses: "ramsey/composer-install@v3" |
57 | 34 | with:
|
58 |
| - timeout_minutes: 10 |
59 |
| - max_attempts: 3 |
60 |
| - command: composer update ${{ env.COMPOSER_FLAGS }} |
| 35 | + dependency-versions: "${{ matrix.composer }}" |
| 36 | + |
61 | 37 | - name: composer validate
|
62 | 38 | run: composer validate --strict
|
63 |
| - - name: Test with phpunit (with coverage) |
64 |
| - id: phpunit-coverage |
65 |
| - if: "matrix.coverage == 'coverage'" |
66 |
| - run: vendor/bin/phpunit --verbose ${{ env.COVERAGE_FLAGS }} |
67 |
| - - name: Test with phpunit (without coverage) |
68 |
| - if: "matrix.coverage != 'coverage'" |
69 |
| - run: vendor/bin/phpunit --verbose |
70 |
| - - name: Submit Coveralls |
71 |
| - if: steps.phpunit-coverage.outcome == 'success' |
72 |
| - uses: nick-invision/retry@v1 |
73 |
| - with: |
74 |
| - timeout_minutes: 10 |
75 |
| - max_attempts: 3 |
76 |
| - command: | |
77 |
| - [[ -f vendor/bin/php-coveralls ]] && COVERALLS_PATH=vendor/bin/php-coveralls || COVERALLS_PATH=vendor/bin/coveralls |
78 |
| - [[ -n $COVERALLS_REPO_TOKEN ]] && php $COVERALLS_PATH -v --exclude-no-stmt || true |
79 |
| - env: |
80 |
| - COVERALLS_RUN_LOCALLY: 1 |
81 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 39 | + |
| 40 | + - name: Run unit tests |
| 41 | + run: "./vendor/bin/phpunit --colors=always --coverage-clover build/logs/clover.xml --coverage-text" |
| 42 | + |
| 43 | + - name: Publish coverage report to Codecov |
| 44 | + uses: "codecov/codecov-action@v5" |
0 commit comments