Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | name: CI |
| 2 | |
| 3 | on: [push] |
| 4 | |
| 5 | jobs: |
| 6 | |
| 7 | tests: |
| 8 | runs-on: ubuntu-latest |
| 9 | strategy: |
| 10 | matrix: |
| 11 | php: [7.2, 7.3, 7.4, 8.0] |
| 12 | dependency-version: [prefer-lowest, prefer-stable] |
| 13 | steps: |
| 14 | - name: Checkout code |
| 15 | uses: actions/checkout@v1 |
| 16 | |
| 17 | - name: Setup PHP |
| 18 | uses: shivammathur/setup-php@v2 |
| 19 | with: |
| 20 | php-version: ${{ matrix.php }} |
| 21 | extensions: mailparse |
| 22 | coverage: none |
| 23 | |
| 24 | - name: Install dependencies |
| 25 | run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest --no-progress |
| 26 | |
| 27 | - name: Execute tests |
| 28 | run: vendor/bin/phpunit |
| 29 | |
| 30 | php-cs: |
| 31 | runs-on: ubuntu-latest |
| 32 | steps: |
| 33 | - name: Checkout code |
| 34 | uses: actions/checkout@v1 |
| 35 | |
| 36 | - name: Install dependencies |
| 37 | run: composer update --no-progress --ignore-platform-reqs |
| 38 | |
| 39 | - name: Execute phpcs |
| 40 | run: vendor/bin/phpcs src tests --standard=psr2 |
| 41 | |
| 42 | coverage: |
| 43 | runs-on: ubuntu-latest |
| 44 | steps: |
| 45 | - name: Checkout code |
| 46 | uses: actions/checkout@v1 |
| 47 | |
| 48 | - name: Setup PHP |
| 49 | uses: shivammathur/setup-php@v2 |
| 50 | with: |
| 51 | php-version: 7.4 |
| 52 | extensions: mailparse |
| 53 | |
| 54 | - name: Install dependencies |
| 55 | run: composer update --prefer-dist --no-interaction --no-suggest --no-progress |
| 56 | |
| 57 | - name: Execute code coverage |
| 58 | run: | |
| 59 | vendor/bin/phpunit --coverage-clover=coverage.xml --whitelist src |
| 60 | bash <(curl -s https://codecov.io/bash) -t ${{ secrets.COVERALLS_REPO_TOKEN }} |