|
| 1 | +# Primary CI checks for Rollbar-PHP-Laravel. |
| 2 | +# |
| 3 | +# Test with act: |
| 4 | +# brew install act |
| 5 | +# act -P ubuntu-latest=shivammathur/node:latest |
| 6 | +# |
| 7 | +# @see https://github.com/nektos/act/issues/329 |
| 8 | +name: Rollbar-PHP-Laravel CI |
| 9 | + |
| 10 | +# Fire this action on pushes to main branch (master) as well as pull requests |
| 11 | +# (push: without any configuration assumes this). Also, run every day at 02:42 |
| 12 | +# GMT -- this catches failures from dependencies that update indepdently. |
| 13 | +on: |
| 14 | + push: |
| 15 | + schedule: |
| 16 | + - cron: '42 2 * * *' |
| 17 | + |
| 18 | +jobs: |
| 19 | + # Check that this runs on PHP on all versions we claim to support, on both |
| 20 | + # UNIX-like and Windows environments, and that use both the lowest possible |
| 21 | + # compatible version as well as the most-recent stable version. This will |
| 22 | + # fail-fast by default, so we include our edgiest versions (currently 7.4) |
| 23 | + # first as they're most likely to fail. |
| 24 | + # @seealso https://freek.dev/1546 |
| 25 | + # @seealso https://www.dereuromark.de/2019/01/04/test-composer-dependencies-with-prefer-lowest/ |
| 26 | + php-tests: |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + php: [7.3, 7.2] |
| 30 | + dependency: [stable] |
| 31 | + os: [ubuntu] |
| 32 | + |
| 33 | + name: PHP ${{ matrix.php }} on ${{ matrix.os }}, ${{ matrix.dependency }} dependencies preferred |
| 34 | + runs-on: ${{ matrix.os }}-latest |
| 35 | + steps: |
| 36 | + - name: Checkout the code |
| 37 | + uses: actions/checkout@v2 |
| 38 | + |
| 39 | + - name: Install PHP and composer environment |
| 40 | + uses: shivammathur/setup-php@v2 |
| 41 | + with: |
| 42 | + php-version: ${{ matrix.php }} |
| 43 | + extensions: curl |
| 44 | + ini-values: ${{ matrix.ini }} |
| 45 | + coverage: xdebug |
| 46 | + |
| 47 | + - name: Get composer cache directory |
| 48 | + id: composer-cache |
| 49 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 50 | + |
| 51 | + - name: Cache dependencies |
| 52 | + uses: actions/cache@v2 |
| 53 | + with: |
| 54 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 55 | + key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency }}- |
| 56 | + restore-keys: ${{ matrix.os }}-composer-${{ matrix.dependency }}- |
| 57 | + |
| 58 | + - name: Install dependencies |
| 59 | + run: composer update --prefer-${{ matrix.dependency }} --prefer-dist --no-interaction |
| 60 | + |
| 61 | + - name: Make logs directory |
| 62 | + run: mkdir -p build/logs |
| 63 | + |
| 64 | + - name: Execute tests |
| 65 | + run: composer test |
| 66 | + |
| 67 | + - name: Report results |
| 68 | + if: success() |
| 69 | + run: ./vendor/bin/php-coveralls -v || true |
0 commit comments