|
| 1 | +name: Testing Suite |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + build-and-test-linux: |
| 6 | + services: |
| 7 | + mongodb: |
| 8 | + image: mongo:4.2 |
| 9 | + ports: |
| 10 | + - 27017:27017 |
| 11 | + runs-on: ${{ matrix.operating-system }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + operating-system: [ubuntu-latest] |
| 16 | + php-versions: ['7.4'] |
| 17 | + |
| 18 | + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} |
| 19 | + steps: |
| 20 | + |
| 21 | + - name: Git checkout |
| 22 | + uses: actions/checkout@v2-beta |
| 23 | + with: |
| 24 | + fetch-depth: 1 |
| 25 | + |
| 26 | + - name: Get Composer Cache Directory |
| 27 | + id: composer-cache |
| 28 | + run: | |
| 29 | + echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 30 | + - name: Setup Cache |
| 31 | + uses: actions/cache@v1 |
| 32 | + with: |
| 33 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 34 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-composer- |
| 37 | + - name: Setup Composer Token |
| 38 | + run: | |
| 39 | + # To increase the Composer rate limit we're use GitHub authentication |
| 40 | + if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then |
| 41 | + composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}" |
| 42 | + fi |
| 43 | + - name: Setup PHP |
| 44 | + uses: shivammathur/setup-php@v1 |
| 45 | + with: |
| 46 | + php-version: ${{ matrix.php-versions }} |
| 47 | + ini-values: apc.enable_cli=on, session.save_path=/tmp |
| 48 | + tools: pecl |
| 49 | + extensions: mbstring, intl, json, imagick, phalcon |
| 50 | + |
| 51 | + - name: Install packages |
| 52 | + run: composer install --prefer-dist |
| 53 | + |
| 54 | + - name: Setup tests |
| 55 | + run: | |
| 56 | + cp tests/_ci/.env.default .env |
| 57 | + vendor/bin/codecept build |
| 58 | + - name: Run integration tests |
| 59 | + run: vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml |
0 commit comments