Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/reusable-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Validate

on:
workflow_call:

permissions: {}

jobs:
validate:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: ['5.4', 'latest']

name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: composer update --no-interaction --no-progress

- name: Validate Composer installation
run: composer validate --no-check-all --strict
15 changes: 15 additions & 0 deletions .github/workflows/validate-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Validate Cronjob

on:
# Run the validation workflow on day 15 of every month as the repo isn't that active.
schedule:
- cron: '0 0 15 * *'

permissions: {}

jobs:
validate:
# Don't run the cron job on forks.
if: ${{ github.event.repository.fork == false }}

uses: ./.github/workflows/reusable-validate.yml
33 changes: 1 addition & 32 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,11 @@ on:
# Run on all pushes and pull requests.
push:
pull_request:
# Also run this workflow on day 15 of every month as the repo isn't that active.
schedule:
- cron: '0 0 15 * *'
# Allow manually triggering the workflow.
workflow_dispatch:

permissions: {}

jobs:
validate:
# Don't run the cron job on forks.
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: ['5.4', 'latest']

name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Install PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: composer update --no-interaction --no-progress

- name: Validate Composer installation
run: composer validate --no-check-all --strict
uses: ./.github/workflows/reusable-validate.yml