mirror of
https://github.com/getgrav/grav.git
synced 2026-03-02 10:31:41 +01:00
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
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.
|
|
|