|
| 1 | +name: "CI" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - "master" |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "master" |
| 10 | + |
| 11 | +env: |
| 12 | + fail-fast: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + phpunit: |
| 16 | + name: "PHPUnit (PHP ${{ matrix.php }})" |
| 17 | + runs-on: "ubuntu-20.04" |
| 18 | + |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + php: |
| 22 | + - "5.6" |
| 23 | + - "7.0" |
| 24 | + - "7.1" |
| 25 | + - "7.2" |
| 26 | + - "7.3" |
| 27 | + - "7.4" |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: "Checkout" |
| 31 | + uses: "actions/checkout@v2" |
| 32 | + with: |
| 33 | + fetch-depth: 2 |
| 34 | + |
| 35 | + - name: "Install PHP with PCOV" |
| 36 | + uses: "shivammathur/setup-php@v2" |
| 37 | + with: |
| 38 | + php-version: "${{ matrix.php }}" |
| 39 | + coverage: "none" |
| 40 | + tools: composer:v1 |
| 41 | + extensions: curl |
| 42 | + ini-values: "date.timezone=Europe/Paris" |
| 43 | + env: |
| 44 | + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + |
| 46 | + - name: "Install dependencies with Composer" |
| 47 | + uses: "ramsey/composer-install@v1" |
| 48 | + |
| 49 | + - name: "Run PHPUnit" |
| 50 | + run: "php vendor/bin/simple-phpunit -v" |
| 51 | + |
| 52 | + phpunit-coverage: |
| 53 | + name: "PHPUnit with coverage (PHP ${{ matrix.php }})" |
| 54 | + runs-on: "ubuntu-20.04" |
| 55 | + |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + php: |
| 59 | + - "7.4" |
| 60 | + |
| 61 | + steps: |
| 62 | + - name: "Checkout" |
| 63 | + uses: "actions/checkout@v2" |
| 64 | + with: |
| 65 | + fetch-depth: 2 |
| 66 | + |
| 67 | + - name: "Install PHP with PCOV" |
| 68 | + uses: "shivammathur/setup-php@v2" |
| 69 | + with: |
| 70 | + php-version: "${{ matrix.php }}" |
| 71 | + coverage: "pcov" |
| 72 | + tools: composer:v1 |
| 73 | + extensions: curl |
| 74 | + ini-values: "date.timezone=Europe/Paris" |
| 75 | + env: |
| 76 | + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + |
| 78 | + - name: "Install dependencies with Composer" |
| 79 | + uses: "ramsey/composer-install@v1" |
| 80 | + |
| 81 | + - name: "Run PHPUnit (with coverage)" |
| 82 | + run: "php vendor/bin/simple-phpunit -v --coverage-clover=coverage.clover" |
| 83 | + |
| 84 | + - name: "Retrieve ocular.phar" |
| 85 | + run: "wget https://scrutinizer-ci.com/ocular.phar" |
| 86 | + |
| 87 | + - name: "Enable ocular.phar" |
| 88 | + run: "chmod +x ocular.phar" |
| 89 | + |
| 90 | + - name: "Upload coverage" |
| 91 | + run: "php ocular.phar code-coverage:upload --format=php-clover coverage.clover" |
0 commit comments