|
| 1 | +name: Integration |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + paths-ignore: |
| 11 | + - 'docs/**' |
| 12 | + - 'examples/**' |
| 13 | + - 'README.md' |
| 14 | + |
| 15 | +jobs: |
| 16 | + static-analysis: |
| 17 | + name: Static Code Analysis |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Install PHP with extensions |
| 24 | + uses: shivammathur/setup-php@v2 |
| 25 | + with: |
| 26 | + php-version: ${{ matrix.php }} |
| 27 | + tools: 'composer:v2, flex' |
| 28 | + |
| 29 | + - name: Install Package Deps |
| 30 | + uses: ramsey/composer-install@v2 |
| 31 | + with: |
| 32 | + dependency-versions: stable |
| 33 | + composer-options: --prefer-dist |
| 34 | + |
| 35 | + - name: Install Psalm |
| 36 | + uses: ramsey/composer-install@v2 |
| 37 | + with: |
| 38 | + composer-options: --prefer-dist |
| 39 | + working-directory: tools/psalm |
| 40 | + |
| 41 | + - name: Run static code analysis |
| 42 | + env: |
| 43 | + MARKDOWN_LINK_BRANCH: ${{ github.head_ref || github.ref_name }} |
| 44 | + run: | |
| 45 | + tools/psalm/vendor/bin/psalm |
| 46 | +
|
| 47 | + - name: Publish report in PR |
| 48 | + uses: mshick/add-pr-comment@v2 |
| 49 | + with: |
| 50 | + message-path: ./psalm-report.md |
| 51 | + message-id: psalm |
| 52 | + |
| 53 | + |
| 54 | + codestyle: |
| 55 | + name: Code Style |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: Checkout code |
| 59 | + uses: actions/checkout@v2 |
| 60 | + |
| 61 | + - name: Install PHP with extensions |
| 62 | + uses: shivammathur/setup-php@v2 |
| 63 | + with: |
| 64 | + coverage: xdebug |
| 65 | + php-version: ${{ matrix.php }} |
| 66 | + tools: 'composer:v2, flex' |
| 67 | + |
| 68 | + - name: Install Package Deps |
| 69 | + uses: ramsey/composer-install@v2 |
| 70 | + with: |
| 71 | + dependency-versions: stable |
| 72 | + composer-options: --prefer-dist |
| 73 | + |
| 74 | + - name: Install PHP-CS-Fixer |
| 75 | + uses: ramsey/composer-install@v2 |
| 76 | + with: |
| 77 | + dependency-versions: stable |
| 78 | + composer-options: --prefer-dist |
| 79 | + working-directory: tools/php-cs-fixer |
| 80 | + |
| 81 | + - name: PHP-CS-Fixer |
| 82 | + run: PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=dots --ansi --verbose |
| 83 | + |
| 84 | + tests: |
| 85 | + name: Test ${{ matrix.php }}, symfony=${{ matrix.symfony }}, deps=${{ matrix.deps }} |
| 86 | + runs-on: ubuntu-latest |
| 87 | + needs: [ codestyle, static-analysis ] |
| 88 | + env: |
| 89 | + SYMFONY_DEPRECATIONS_HELPER: 'max[self]=0' |
| 90 | + strategy: |
| 91 | + matrix: |
| 92 | + include: |
| 93 | + - php: 8.1 |
| 94 | + deps: lowest |
| 95 | + symfony: ^6.4 |
| 96 | + |
| 97 | + - php: 8.2 |
| 98 | + deps: stable |
| 99 | + symfony: ^7.1 |
| 100 | + |
| 101 | + - php: 8.3 |
| 102 | + deps: latest |
| 103 | + symfony: ^7.2 |
| 104 | + |
| 105 | + - php: 8.4 |
| 106 | + deps: latest |
| 107 | + symfony: ^7.2 |
| 108 | + |
| 109 | + steps: |
| 110 | + - name: Checkout code |
| 111 | + uses: actions/checkout@v4 |
| 112 | + |
| 113 | + - name: Install PHP with extensions |
| 114 | + uses: shivammathur/setup-php@v2 |
| 115 | + with: |
| 116 | + php-version: ${{ matrix.php }} |
| 117 | + tools: 'composer:v2, flex' |
| 118 | + |
| 119 | + - name: Configure Symfony version |
| 120 | + run: echo SYMFONY_REQUIRE="${{ matrix.symfony }}" >> $GITHUB_ENV |
| 121 | + |
| 122 | + - name: Set up problem matchers for PHP |
| 123 | + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 124 | + |
| 125 | + - name: Set up problem matchers for phpunit |
| 126 | + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 127 | + |
| 128 | + - name: Install Package Deps |
| 129 | + uses: ramsey/composer-install@v2 |
| 130 | + with: |
| 131 | + dependency-versions: ${{ matrix.deps }} |
| 132 | + composer-options: --prefer-dist |
| 133 | + |
| 134 | + - name: Install PHPUnit |
| 135 | + uses: ramsey/composer-install@v2 |
| 136 | + with: |
| 137 | + dependency-versions: ${{ matrix.deps }} |
| 138 | + composer-options: --prefer-dist |
| 139 | + working-directory: tools/phpunit |
| 140 | + |
| 141 | + - name: Run tests |
| 142 | + run: tools/phpunit/vendor/bin/phpunit --colors=always --testdox |
| 143 | + |
| 144 | + coverage: |
| 145 | + name: Coverage Report |
| 146 | + runs-on: ubuntu-latest |
| 147 | + needs: [ codestyle, static-analysis, tests ] |
| 148 | + steps: |
| 149 | + - name: Checkout code |
| 150 | + uses: actions/checkout@v2 |
| 151 | + |
| 152 | + - name: Install PHP with extensions |
| 153 | + uses: shivammathur/setup-php@v2 |
| 154 | + with: |
| 155 | + coverage: xdebug |
| 156 | + php-version: ${{ matrix.php }} |
| 157 | + tools: 'composer:v2, flex' |
| 158 | + |
| 159 | + - name: Install Package Deps |
| 160 | + uses: ramsey/composer-install@v2 |
| 161 | + with: |
| 162 | + dependency-versions: stable |
| 163 | + composer-options: --prefer-dist |
| 164 | + |
| 165 | + - name: Install PHPUnit |
| 166 | + uses: ramsey/composer-install@v2 |
| 167 | + with: |
| 168 | + composer-options: --prefer-dist |
| 169 | + working-directory: tools/phpunit |
| 170 | + |
| 171 | + - name: Create Coverage Report |
| 172 | + run: tools/phpunit/vendor/bin/phpunit --colors=always --coverage-text --coverage-clover=./clover.xml |
| 173 | + |
| 174 | + - name: Publish Coverage Report |
| 175 | + uses: codecov/codecov-action@v3.1.5 |
| 176 | + with: |
| 177 | + files: ./clover.xml |
| 178 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments