Skip to content

Commit 5d01861

Browse files
authored
Merge pull request #42 from PHPCompatibility/feature/ghactions-split-workflow
GH Actions: split workflow
2 parents 49b0e8d + 9d1470d commit 5d01861

File tree

3 files changed

+51
-32
lines changed

3 files changed

+51
-32
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Validate
2+
3+
on:
4+
workflow_call:
5+
6+
permissions: {}
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
php: ['5.4', 'latest']
16+
17+
name: PHP ${{ matrix.php }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
with:
23+
persist-credentials: false
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
27+
with:
28+
php-version: ${{ matrix.php }}
29+
coverage: none
30+
31+
- name: Install dependencies
32+
run: composer update --no-interaction --no-progress
33+
34+
- name: Validate Composer installation
35+
run: composer validate --no-check-all --strict
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Validate Cronjob
2+
3+
on:
4+
# Run the validation workflow on day 15 of every month as the repo isn't that active.
5+
schedule:
6+
- cron: '0 0 15 * *'
7+
8+
permissions: {}
9+
10+
jobs:
11+
validate:
12+
# Don't run the cron job on forks.
13+
if: ${{ github.event.repository.fork == false }}
14+
15+
uses: ./.github/workflows/reusable-validate.yml

.github/workflows/validate.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,11 @@ on:
44
# Run on all pushes and pull requests.
55
push:
66
pull_request:
7-
# Also run this workflow on day 15 of every month as the repo isn't that active.
8-
schedule:
9-
- cron: '0 0 15 * *'
107
# Allow manually triggering the workflow.
118
workflow_dispatch:
129

1310
permissions: {}
1411

1512
jobs:
1613
validate:
17-
# Don't run the cron job on forks.
18-
if: ${{ github.event_name != 'schedule' || github.event.repository.fork == false }}
19-
20-
runs-on: ubuntu-latest
21-
22-
strategy:
23-
fail-fast: true
24-
matrix:
25-
php: ['5.4', 'latest']
26-
27-
name: PHP ${{ matrix.php }}
28-
29-
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32-
with:
33-
persist-credentials: false
34-
35-
- name: Install PHP
36-
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
37-
with:
38-
php-version: ${{ matrix.php }}
39-
coverage: none
40-
41-
- name: Install dependencies
42-
run: composer update --no-interaction --no-progress
43-
44-
- name: Validate Composer installation
45-
run: composer validate --no-check-all --strict
14+
uses: ./.github/workflows/reusable-validate.yml

0 commit comments

Comments
 (0)