Skip to content

Commit

Permalink
build(.github) more selective run of tests on pull request, unify for…
Browse files Browse the repository at this point in the history
…matting
  • Loading branch information
lucatume committed Oct 14, 2023
1 parent e10f312 commit fc8d498
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 69 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: docs
on:
pull_request:
paths:
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
push:
paths:
- 'docs/**'
- mkdocs.yml
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
branches:
- master
permissions:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/phpcbf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

name: "PHPCBF automatically fix violations"

on: # yamllint disable-line rule:truthy
push:
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- "src/**"
- "includes/**"
- ".github/workflows/phpcbf.yml"
push:
paths:
- "src/**"J
- "includes/**"
- ".github/workflows/phpcbf.yml"
branches:
- master

Expand All @@ -17,29 +23,23 @@ jobs:
permissions:
contents: write
steps:
-
name: "Set up PHP"
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
coverage: "none"
-
name: "Checkout repository"
- name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Validate Composer configuration"
- name: "Validate Composer configuration"
run: "composer validate --no-interaction --strict"
-
name: "Install dependencies"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
-
name: "Run PHPCBF"
- name: "Run PHPCBF"
continue-on-error: true
run: "composer run cs-fix"
-
name: Commit PHPCBF changes
- name: Commit PHPCBF changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "🤖 PHPCBF"
8 changes: 3 additions & 5 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: "Spelling"

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
pull_request: null
push:
branches:
Expand All @@ -21,11 +21,9 @@ jobs:
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
- name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Search for misspellings"
- name: "Search for misspellings"
uses: "crate-ci/typos@master"
with:
config: ./config/typos.toml
93 changes: 46 additions & 47 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,55 @@

name: "Static Analysis"

on: # yamllint disable-line rule:truthy
pull_request: null
push:
paths:
- "src/**"
- "includes/**"
- "tests/**"
- "composer.json"
branches:
- "master"
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- "src/**"
- "includes/**"
- "tests/**"
- "composer.json"
- ".github/workflows/static-analysis.yml"
push:
paths:
- "src/**"
- "includes/**"
- "tests/**"
- "composer.json"
- ".github/workflows/static-analysis.yml"
branches:
- "master"

permissions:
contents: "read"
contents: "read"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
static_analysis:
name: "Static Analysis"
runs-on: "ubuntu-22.04"
steps:
-
name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
coverage: "none"
-
name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Validate Composer configuration"
run: "composer validate --no-interaction --strict"
-
name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
-
name: "Check PSR-4 mapping"
run: "composer dump-autoload --no-interaction --optimize --strict-psr"
-
name: "Run PHPHStan"
run: "composer run stan"
-
name: "Run PHPCBF"
continue-on-error: true
run: "composer run cs-fix"
-
name: "Run PHP Code Sniffer"
run: "composer run cs"
static_analysis:
name: "Static Analysis"
runs-on: "ubuntu-22.04"
steps:
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
coverage: "none"
- name: "Checkout repository"
uses: "actions/checkout@v3"
- name: "Validate Composer configuration"
run: "composer validate --no-interaction --strict"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
- name: "Check PSR-4 mapping"
run: "composer dump-autoload --no-interaction --optimize --strict-psr"
- name: "Run PHPHStan"
run: "composer run stan"
- name: "Run PHPCBF"
continue-on-error: true
run: "composer run cs-fix"
- name: "Run PHP Code Sniffer"
run: "composer run cs"
9 changes: 8 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
name: Test

on: # yamllint disable-line rule:truthy
pull_request: null
pull_request:
paths:
- "src/**"
- "includes/**"
- "tests/**"
- "composer.json"
- ".github/workflows/test.yaml"
push:
paths:
- "src/**"
- "includes/**"
- "tests/**"
- "composer.json"
- ".github/workflows/test.yaml"
branches:
- "master"

Expand Down

0 comments on commit fc8d498

Please sign in to comment.