Skip to content

CI

CI #41

Workflow file for this run

name: "CI"
on:
pull_request:
types: [ "opened", "synchronize", "edited", "reopened" ]
paths-ignore:
- "docs/**"
push:
branches:
- "**"
paths-ignore:
- "docs/**"
schedule:
- cron: "0 8 * * 1" # At 08:00 on Monday
workflow_dispatch:
inputs: {}
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: "read"
jobs:
coding-standard:
name: "Coding standard"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
- name: "PHP_CodeSniffer"
uses: "orisai/github-workflows/.github/actions/php-codesniffer@v1"
with:
command: "make cs ARGS='--report=checkstyle -q | vendor/bin/cs2pr'"
cache-path: "var/tools/PHP_CodeSniffer"
static-analysis:
name: "Static analysis"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
- name: "PHPStan"
uses: "orisai/github-workflows/.github/actions/phpstan@v1"
with:
command: "make phpstan"
cache-path: "var/tools/PHPStan"
status-check:
name: "Status check - ${{ github.workflow }}"
runs-on: "ubuntu-latest"
needs: [ "coding-standard", "static-analysis" ]
if: "${{ always() }}"
steps:
- name: "Check required jobs are successful"
uses: "orisai/github-workflows/.github/actions/status-check@v1"
with:
needs: "${{ toJSON(needs) }}"