123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- name: PHP Tests
- on:
- push:
- branches: [ develop ]
- pull_request:
- branches: [ develop ]
- jobs:
- test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- php: [ 7.4, 7.3, 7.2 ]
- os: [ubuntu-latest]
- steps:
- - uses: actions/checkout@v2
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- extensions: opcache, gd
- coverage: none
- - name: Validate composer.json and composer.lock
- run: composer validate
- - name: Get composer cache directory
- id: composer-cache
- run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- - name: Cache dependencies
- uses: actions/cache@v2
- with:
- path: ${{ steps.composer-cache.outputs.dir }}
- key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- restore-keys: ${{ runner.os }}-composer-
- - name: Install dependencies
- run: composer install --prefer-dist --no-progress
- - name: Run test suite
- run: vendor/bin/codecept run
- - name: Slack Notification
- uses: 8398a7/action-slack@v3
- with:
- status: custom
- fields: workflow,job,commit,repo,ref,author,took
- custom_payload: |
- {
- username: 'action-slack',
- icon_emoji: ':octocat:',
- attachments: [{
- color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
- text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} succeeded in ${process.env.AS_TOOK}`,
- }]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
- if: always() # Pick up events even if the job fails or is canceled.
-
|