Daniel Rudolf 6f1fc9f8de
CI: Run 'test' workflow as part of the 'deploy-branch' workflow
Mimics the behaviour of the 'deploy-release' workflow, even though branch deployment doesn't depend on Pico's tests to succeed. Pull requests still use the 'test' workflow directly.
2022-02-27 23:05:28 +01:00

49 lines
1.2 KiB
YAML

name: Test Pico CMS
on:
pull_request: {}
workflow_call: {}
jobs:
test:
name: PHP ${{ matrix.PHP_VERSION }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
PHP_VERSION:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- 'nightly'
fail-fast: false
continue-on-error: ${{ matrix.PHP_VERSION == 'nightly' }}
env:
PHP_VERSION: ${{ matrix.PHP_VERSION }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Pico CMS
uses: ./.github/actions/install
with:
php-version: ${{ env.PHP_VERSION }}
php-tools: phpcs
- name: Check Pico version
if: ${{ github.ref_type == 'tag' }}
run: |
[ "$GITHUB_REF_NAME" == "v$PICO_VERSION" ]
- name: Run PHP_CodeSniffer
run: |
phpcs --standard=.phpcs.xml