Skip to content

Commit

Permalink
ci: deduplicate workflows runs
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroTroller committed Feb 26, 2024
1 parent 4301776 commit 6043096
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/bc.yml → .github/workflows/bc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
on: [push, pull_request]
---
name: Roave

on: workflow_call

jobs:
roave_bc_check:
name: BC Check
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on: [push, pull_request]
name: Static analysis
---
name: Linters

on: workflow_call

jobs:
phpstan:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Pull-Request

on: pull_request

env:
PHP_VERSIONS: '["8.0", "8.1", "8.2"]'

jobs:
bc:
uses: ./.github/workflows/bc.yaml

test:
uses: ./.github/workflows/test.yaml
with:
PHP_VERSIONS: ${{ env.PHP_VERSIONS }}

linter:
uses: ./.github/workflows/linter.yaml
19 changes: 19 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Push

on:
push:
branches:
- master

jobs:
bc:
uses: ./.github/workflows/bc.yaml

test:
uses: ./.github/workflows/test.yaml
with:
PHP_VERSIONS: ${{ toJson(["8.0", "8.1", "8.2"]) }}

linter:
uses: ./.github/workflows/linter.yaml
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
name: Tests
on: [push, pull_request]

on:
workflow_call:
inputs:
PHP_VERSIONS:
type: string
required: true

jobs:

Expand All @@ -9,7 +16,7 @@ jobs:
strategy:
max-parallel: 10
matrix:
php: ['8.0', '8.1', '8.2']
php: ${{ fromJson(inputs.PHP_VERSIONS) }}

steps:
- name: Set up PHP
Expand Down

0 comments on commit 6043096

Please sign in to comment.