|
| 1 | +--- |
| 2 | +name: CI |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - '*' |
| 11 | + |
| 12 | +jobs: |
| 13 | + testsuite-linux: |
| 14 | + runs-on: ubuntu-18.04 |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + php-version: ['5.6', '7.4', '8.0'] |
| 19 | + prefer-lowest: [''] |
| 20 | + include: |
| 21 | + - php-version: '5.6' |
| 22 | + prefer-lowest: 'prefer-lowest' |
| 23 | + |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v1 |
| 26 | + with: |
| 27 | + fetch-depth: 1 |
| 28 | + |
| 29 | + - name: Setup PHP |
| 30 | + uses: shivammathur/setup-php@v2 |
| 31 | + with: |
| 32 | + coverage: none |
| 33 | + php-version: ${{ matrix.php-version }} |
| 34 | + extensions: mbstring, intl |
| 35 | + |
| 36 | + - name: Get composer cache directory |
| 37 | + id: composer-cache |
| 38 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 39 | + |
| 40 | + - name: Get date part for cache key |
| 41 | + id: key-date |
| 42 | + run: echo "::set-output name=date::$(date +'%Y-%m')" |
| 43 | + |
| 44 | + - name: Cache composer dependencies |
| 45 | + uses: actions/cache@v1 |
| 46 | + with: |
| 47 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 48 | + key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} |
| 49 | + |
| 50 | + - name: Composer install |
| 51 | + run: | |
| 52 | + if [[ ${{ matrix.php-version }} == '8.0' ]]; then |
| 53 | + composer install --ignore-platform-reqs |
| 54 | + elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then |
| 55 | + composer update --prefer-lowest --prefer-stable |
| 56 | + else |
| 57 | + composer install |
| 58 | + fi |
| 59 | +
|
| 60 | + - name: Run PHPUnit |
| 61 | + run: | |
| 62 | + if [[ ${{ matrix.php-version }} == '5.6' ]]; then |
| 63 | + vendor/bin/phpunit tests/php56/ |
| 64 | + else |
| 65 | + vendor/bin/phpunit |
| 66 | + fi |
| 67 | +
|
| 68 | + cs-stan: |
| 69 | + name: Coding Standard & Static Analysis |
| 70 | + runs-on: ubuntu-18.04 |
| 71 | + |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v1 |
| 74 | + with: |
| 75 | + fetch-depth: 1 |
| 76 | + |
| 77 | + - name: Setup PHP |
| 78 | + uses: shivammathur/setup-php@v2 |
| 79 | + with: |
| 80 | + php-version: '7.4' |
| 81 | + extensions: mbstring, intl |
| 82 | + coverage: none |
| 83 | + tools: psalm:~4.1.0 |
| 84 | + |
| 85 | + - name: Composer Install |
| 86 | + run: composer install |
| 87 | + |
| 88 | + - name: Run phpcs |
| 89 | + run: vendor/bin/phpcs -p src/ tests/ |
| 90 | + |
| 91 | + - name: Run psalm |
| 92 | + run: psalm --output-format=github |
0 commit comments