|
| 1 | +name: Build version 4 development |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - "v4" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ${{ matrix.host-os }} |
| 11 | + continue-on-error: ${{ matrix.experimental }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + php-versions: ["7.4", "8.0", "8.1", "8.2"] |
| 16 | + host-os: ["ubuntu-latest", "windows-latest"] |
| 17 | + experimental: [false] |
| 18 | + |
| 19 | + name: PHP ${{ matrix.php-versions }} - OS ${{ matrix.host-os }} |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v3 |
| 23 | + |
| 24 | + - name: Setup PHP |
| 25 | + uses: shivammathur/setup-php@v2 |
| 26 | + with: |
| 27 | + php-version: ${{ matrix.php-versions }} |
| 28 | + coverage: none |
| 29 | + extensions: sockets, intl, bz2, zip |
| 30 | + |
| 31 | + - name: Get composer cache directory (Ubuntu) |
| 32 | + id: composercache-ubuntu |
| 33 | + run: | |
| 34 | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 35 | + if: ${{ startsWith( matrix.host-os , 'ubuntu') }} |
| 36 | + |
| 37 | + - name: Cache dependencies (Ubuntu) |
| 38 | + uses: actions/cache@v3 |
| 39 | + with: |
| 40 | + path: ${{ steps.composercache-ubuntu.outputs.dir }} |
| 41 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-composer- |
| 44 | + if: ${{ startsWith( matrix.host-os , 'ubuntu') }} |
| 45 | + |
| 46 | + - name: Get composer cache directory (Windows) |
| 47 | + id: composercache-windows |
| 48 | + run: | |
| 49 | + echo "dir=$(composer config cache-files-dir)" >> $env:GITHUB_OUTPUT |
| 50 | + if: ${{ startsWith( matrix.host-os , 'windows') }} |
| 51 | + |
| 52 | + - name: Cache dependencies (Windows) |
| 53 | + uses: actions/cache@v3 |
| 54 | + with: |
| 55 | + path: ${{ steps.composercache-windows.outputs.dir }} |
| 56 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 57 | + restore-keys: | |
| 58 | + ${{ runner.os }}-composer- |
| 59 | + if: ${{ startsWith( matrix.host-os , 'windows') }} |
| 60 | + |
| 61 | + - name: Install dependencies |
| 62 | + run: composer install --prefer-dist --no-progress |
| 63 | + |
| 64 | + - name: Check codestyle |
| 65 | + run: composer check |
| 66 | + |
| 67 | + - name: Run test suite |
| 68 | + run: composer phpunit |
| 69 | + |
| 70 | + - name: Upload coverage to Codecov |
| 71 | + uses: codecov/codecov-action@v3 |
| 72 | + with: |
| 73 | + file: ./clover.xml |
| 74 | + fail_ci_if_error: true |
| 75 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments