|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - dev |
| 8 | + tags: |
| 9 | + - '*' |
| 10 | + pull_request: |
| 11 | + branches: [ master ] |
| 12 | + |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + phpcs: |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + version: ['7.4', '8.1'] |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout the repository |
| 24 | + uses: actions/checkout@v2 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Setup PHP with composer v2 |
| 29 | + uses: shivammathur/setup-php@v2 |
| 30 | + with: |
| 31 | + php-version: ${{ matrix.version }} |
| 32 | + tools: composer:v2 |
| 33 | + |
| 34 | + - name: Install composer packages |
| 35 | + run: | |
| 36 | + php -v |
| 37 | + composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts |
| 38 | +
|
| 39 | + - name: Execute PHP_CodeSniffer |
| 40 | + run: | |
| 41 | + php -v |
| 42 | + composer check-style |
| 43 | +
|
| 44 | + phpunit: |
| 45 | + strategy: |
| 46 | + matrix: |
| 47 | + version: ['7.4', '8.1'] |
| 48 | + runs-on: ubuntu-latest |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout the repository |
| 52 | + uses: actions/checkout@v2 |
| 53 | + with: |
| 54 | + fetch-depth: 0 |
| 55 | + |
| 56 | + - name: Setup PHP |
| 57 | + uses: shivammathur/setup-php@v2 |
| 58 | + with: |
| 59 | + php-version: ${{ matrix.version }} |
| 60 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, intl, exif, iconv |
| 61 | + coverage: xdebug |
| 62 | + |
| 63 | + - name: Install composer packages |
| 64 | + run: | |
| 65 | + php -v |
| 66 | + composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts |
| 67 | +
|
| 68 | + - name: Execute tests |
| 69 | + run: | |
| 70 | + php -v |
| 71 | + ./vendor/phpunit/phpunit/phpunit --version |
| 72 | + ./vendor/phpunit/phpunit/phpunit --coverage-clover=coverage.xml |
| 73 | +# export CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} |
| 74 | +# bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload' |
| 75 | + |
| 76 | +# - name: Upload code coverage |
| 77 | +# run: | |
| 78 | +# export CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} |
| 79 | +# bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload' |
| 80 | + |
| 81 | + package-security-checker: |
| 82 | + runs-on: ubuntu-latest |
| 83 | + |
| 84 | + steps: |
| 85 | + - name: Checkout the repository |
| 86 | + uses: actions/checkout@v2 |
| 87 | + |
| 88 | + - name: Setup PHP |
| 89 | + uses: shivammathur/setup-php@v2 |
| 90 | + |
| 91 | + - name: Install composer packages |
| 92 | + run: | |
| 93 | + php -v |
| 94 | + composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts |
| 95 | +
|
| 96 | + - name: Install security-checker |
| 97 | + run: | |
| 98 | + test -d local-php-security-checker || curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.2.0/local-php-security-checker_1.2.0_linux_amd64 --output local-php-security-checker |
| 99 | + chmod +x local-php-security-checker |
| 100 | + ./local-php-security-checker |
0 commit comments