|
1 | | -name: 'CI' |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
7 | | - pull_request: |
| 4 | + workflow_dispatch: ~ |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + pull_request: ~ |
8 | 9 |
|
9 | 10 | jobs: |
10 | 11 |
|
11 | | - lint: |
12 | | - name: 'Lint' |
13 | | - runs-on: ubuntu-latest |
14 | | - timeout-minutes: 5 |
15 | | - |
16 | | - steps: |
17 | | - - name: 'Checkout' |
18 | | - uses: actions/checkout@v2 |
19 | | - |
20 | | - - name: 'Setup PHP' |
21 | | - uses: shivammathur/setup-php@v2 |
22 | | - with: |
23 | | - coverage: "none" |
24 | | - extensions: "json" |
25 | | - ini-values: "memory_limit=-1" |
26 | | - php-version: "8.0" |
27 | | - |
28 | | - - name: 'Determine composer cache directory' |
29 | | - id: composer-cache |
30 | | - run: echo "::set-output name=directory::$(composer config cache-dir)" |
31 | | - |
32 | | - - name: 'Cache composer dependencies' |
33 | | - uses: actions/cache@v2 |
34 | | - with: |
35 | | - path: ${{ steps.composer-cache.outputs.directory }} |
36 | | - key: 7.4-composer-${{ hashFiles('**/composer.lock') }} |
37 | | - restore-keys: 7.4-composer- |
38 | | - |
39 | | - - name: 'Install dependencies' |
40 | | - id: deps |
41 | | - run: | |
42 | | - echo "::group::composer update" |
43 | | - composer update --no-progress --ansi |
44 | | - echo "::endgroup::" |
45 | | -
|
46 | | - echo "::group::install phpunit" |
47 | | - # Required for PhpStan |
48 | | - vendor/bin/simple-phpunit install |
49 | | - echo "::endgroup::" |
50 | | -
|
51 | | - - name: 'Composer validate' |
52 | | - if: always() && steps.deps.outcome == 'success' |
53 | | - run: composer validate --strict |
54 | | - |
55 | | - - name: 'PHP CS Fixer' |
56 | | - if: always() && steps.deps.outcome == 'success' |
57 | | - run: vendor/bin/php-cs-fixer fix --dry-run --diff |
58 | | - |
59 | | - - name: 'PhpStan' |
60 | | - if: always() && steps.deps.outcome == 'success' |
61 | | - run: vendor/bin/phpstan analyse |
62 | | - |
63 | | - tests: |
64 | | - name: 'Tests' |
65 | | - runs-on: ubuntu-latest |
66 | | - timeout-minutes: 5 |
67 | | - |
68 | | - strategy: |
69 | | - fail-fast: false # don't cancel other matrix jobs on failure |
70 | | - matrix: |
71 | | - php: [ '7.4', '8.0' ] |
72 | | - |
73 | | - steps: |
74 | | - - name: 'Checkout' |
75 | | - uses: actions/checkout@v2 |
76 | | - |
77 | | - - name: 'Setup PHP' |
78 | | - uses: shivammathur/setup-php@v2 |
79 | | - with: |
80 | | - coverage: "none" |
81 | | - extensions: "json" |
82 | | - ini-values: "memory_limit=-1" |
83 | | - php-version: "${{ matrix.php }}" |
84 | | - |
85 | | - - name: 'Determine composer cache directory' |
86 | | - id: composer-cache |
87 | | - run: echo "::set-output name=directory::$(composer config cache-dir)" |
88 | | - |
89 | | - - name: 'Cache composer dependencies' |
90 | | - uses: actions/cache@v2 |
91 | | - with: |
92 | | - path: ${{ steps.composer-cache.outputs.directory }} |
93 | | - key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} |
94 | | - restore-keys: ${{ matrix.php }}-composer- |
95 | | - |
96 | | - #- name: 'Fixup Composer' |
97 | | - # if: matrix.php == 8.0 |
98 | | - # run: | |
99 | | - # echo "::group::Fixup Composer platform config for third-parties deps not PHP 8 ready yet" |
100 | | - # composer config platform.php 7.4.99 |
101 | | - # echo "::endgroup::" |
102 | | - |
103 | | - - name: 'Install dependencies' |
104 | | - run: | |
105 | | - echo "::group::composer update" |
106 | | - composer update --no-progress --ansi |
107 | | - echo "::endgroup::" |
108 | | -
|
109 | | - echo "::group::install phpunit" |
110 | | - vendor/bin/simple-phpunit install |
111 | | - echo "::endgroup::" |
112 | | -
|
113 | | - - name: 'Run tests' |
114 | | - run: vendor/bin/simple-phpunit --testdox |
115 | | - |
| 12 | + lint: |
| 13 | + name: Lint |
| 14 | + runs-on: 'ubuntu-latest' |
| 15 | + timeout-minutes: 5 |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: 'Checkout' |
| 19 | + uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - name: 'Setup PHP' |
| 22 | + uses: shivammathur/setup-php@v2 |
| 23 | + with: |
| 24 | + php-version: '8.3' |
| 25 | + |
| 26 | + - name: 'Install dependencies' |
| 27 | + run: | |
| 28 | + make install |
| 29 | + vendor/bin/simple-phpunit --version |
| 30 | +
|
| 31 | + - name: 'Check style' |
| 32 | + run: make lint |
| 33 | + |
| 34 | + test: |
| 35 | + name: ${{ matrix.name }} |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + timeout-minutes: 8 |
| 38 | + continue-on-error: ${{ matrix.allow-failure == 1 }} |
| 39 | + |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + include: |
| 44 | + # Lowest deps |
| 45 | + - name: 'Test lowest deps Symfony 5.4 [Linux, PHP 7.4]' |
| 46 | + os: 'ubuntu-latest' |
| 47 | + php: '7.4' |
| 48 | + symfony: '5.4.*@dev' |
| 49 | + composer-flags: '--prefer-lowest' |
| 50 | + allow-unstable: true |
| 51 | + |
| 52 | + # Most recent versions |
| 53 | + - name: 'Test Symfony 5.4 [Linux, PHP 8.0]' |
| 54 | + os: 'ubuntu-latest' |
| 55 | + php: '8.0' |
| 56 | + symfony: '5.4.*@dev' |
| 57 | + allow-unstable: true |
| 58 | + |
| 59 | + - name: 'Test Symfony 6.0 [Linux, PHP 8.1]' |
| 60 | + os: 'ubuntu-latest' |
| 61 | + php: '8.1' |
| 62 | + symfony: '6.0.*@dev' |
| 63 | + allow-unstable: true |
| 64 | + |
| 65 | + - name: 'Test next Symfony 6.4 [Linux, PHP 8.2]' |
| 66 | + os: 'ubuntu-latest' |
| 67 | + php: '8.2' |
| 68 | + symfony: '6.4.*@dev' |
| 69 | + allow-unstable: true |
| 70 | + |
| 71 | + # Bleeding edge (unreleased dev versions where failures are allowed) |
| 72 | + - name: 'Test next Symfony [Linux, PHP 8.3] (allowed failure)' |
| 73 | + os: 'ubuntu-latest' |
| 74 | + php: '8.3' |
| 75 | + symfony: '7.0.*@dev' |
| 76 | + composer-flags: '--ignore-platform-req php' |
| 77 | + allow-unstable: true |
| 78 | + allow-failure: true |
| 79 | + |
| 80 | + steps: |
| 81 | + - name: 'Checkout' |
| 82 | + uses: actions/checkout@v2 |
| 83 | + |
| 84 | + - name: 'Setup PHP' |
| 85 | + uses: shivammathur/setup-php@v2 |
| 86 | + with: |
| 87 | + php-version: ${{ matrix.php }} |
| 88 | + extensions: pdo_sqlite |
| 89 | + coverage: pcov |
| 90 | + tools: 'composer:v2,flex' |
| 91 | + |
| 92 | + - name: 'Get composer cache directory' |
| 93 | + id: composer-cache |
| 94 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 95 | + |
| 96 | + - name: 'Cache dependencies' |
| 97 | + uses: actions/cache@v2 |
| 98 | + with: |
| 99 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 100 | + key: ${{ runner.os }}-composer-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }}-flags-${{ matrix.composer-flags }} |
| 101 | + restore-keys: ${{ runner.os }}-composer- |
| 102 | + |
| 103 | + - name: 'Allow unstable packages' |
| 104 | + run: composer config minimum-stability dev |
| 105 | + if: ${{ matrix.allow-unstable }} |
| 106 | + |
| 107 | + - name: 'Install dependencies' |
| 108 | + run: composer update --prefer-dist ${{ matrix.composer-flags }} --ansi |
| 109 | + env: |
| 110 | + SYMFONY_REQUIRE: "${{ matrix.symfony }}" |
| 111 | + |
| 112 | + - name: 'Run PHPUnit tests' |
| 113 | + run: vendor/bin/simple-phpunit --testdox --verbose ${{ matrix.code-coverage && '--coverage-text --coverage-clover build/logs/clover.xml' }} |
0 commit comments