Skip to content

Commit

Permalink
Merge pull request #345 from Yoast/JRF/ghactions-run-more-selectively
Browse files Browse the repository at this point in the history
GH Actions: run workflows more selectively
  • Loading branch information
noud-github authored May 24, 2023
2 parents c383458 + d176d0c commit 7db3e05
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/cs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
name: CS

on:
# Run on all pushes (except to main) and on all pull requests.
# Run on all relevant pushes (except to main) and on all relevant pull requests.
push:
branches-ignore:
- 'main'
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
- '.github/workflows/cs.yml'
pull_request:
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- '.phpcs.xml.dist'
- 'phpcs.xml.dist'
- '.github/workflows/cs.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
name: CheckJS

on:
# Run on pushes to select branches and on all pull requests.
# Run on relevant pushes to select branches and on all relevant pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
paths:
- '**.js' # Includes Gruntfile.js.
- '.eslintignore'
- '.eslintrc'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/js.yml'
- 'grunt/**'
pull_request:
paths:
- '**.js' # Includes Gruntfile.js.
- '.eslintignore'
- '.eslintrc'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/js.yml'
- 'grunt/**'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: Lint

on:
# Run on pushes to select branches and on all pull requests.
# Run on relevant pushes to select branches and on all relevant pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- '.github/workflows/lint.yml'
pull_request:
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- '.github/workflows/lint.yml'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
name: Test

on:
# Run on pushes to select branches and on all pull requests.
# Run on relevant pushes to select branches and on all relevant pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
paths:
- '**.php'
- '**.xsl'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml.dist'
- 'wpml-config.xml'
- '.github/workflows/test.yml'
- 'config/scripts/install-wp-tests.sh'
- 'tests/**'
pull_request:
paths:
- '**.php'
- '**.xsl'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml.dist'
- 'wpml-config.xml'
- '.github/workflows/test.yml'
- 'config/scripts/install-wp-tests.sh'
- 'tests/**'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand Down

0 comments on commit 7db3e05

Please sign in to comment.