Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mutec committed Jan 5, 2025
1 parent e189f20 commit c68c276
Showing 4 changed files with 47 additions and 46 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -5,28 +5,29 @@ on:
branches:
- main
paths:
- '**.php'
- '**.ts'
- '**.scss'
- "**.php"
pull_request:
paths:
- '**.php'
- '**.ts'
- '**.scss'
- "**.php"

permissions:
contents: read

jobs:
php:
name: PHP
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
tools: cs2pr, phpcs, php-cs-fixer
- name: phpcs
run: phpcs -n -q --report=checkstyle | cs2pr
- name: php-cs-fixer
run: php-cs-fixer fix --dry-run --diff
- uses: actions/checkout@v4
- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
tools: cs2pr, phpcs, php-cs-fixer
- name: phpcs
run: |
sudo update-alternatives --set php /usr/bin/php8.1
phpcs -n -q --report=checkstyle | cs2pr
- name: php-cs-fixer
run: php-cs-fixer fix --dry-run --diff
34 changes: 17 additions & 17 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -5,12 +5,15 @@ on:
branches:
- main
tags-ignore:
- '**'
- "**"
paths:
- '**.php'
- "**.php"
pull_request:
paths:
- '**.php'
- "**.php"

permissions:
contents: read

jobs:
syntax:
@@ -20,18 +23,15 @@ jobs:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- "8.1"
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- run: echo "::add-matcher::.github/php-syntax.json"
- name: Remove files to be ignored
run: |
true
- run: |
! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v4
- run: echo "::add-matcher::.github/php-syntax.json"
- run: |
! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'
20 changes: 10 additions & 10 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -16,21 +16,21 @@ jobs:
runs-on: self-hosted
steps:
- name: Check for GitHub's default message.
uses: gsactions/commit-message-checker@c61c81192182bbc0d5e41b4796e3b71684228c77
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(?!Update\s+\S*$).*$'
error: 'Please use a meaningful commit message.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
error: "Please use a meaningful commit message."
excludeDescription: "true"
excludeTitle: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check for unsquashed `fixup!` commits.
if: ${{ ! github.event.pull_request.draft }}
uses: gsactions/commit-message-checker@c61c81192182bbc0d5e41b4796e3b71684228c77
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(?!fixup!(\s|$))'
error: 'A `fixup!` commit was found.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
error: "A `fixup!` commit was found."
excludeDescription: "true"
excludeTitle: "true"
checkAllCommitMessages: "true"
accessToken: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Create package
run: |
rm -rf *.tar.gz
@@ -29,7 +29,7 @@ jobs:
run: |
echo "Packaging FAILED" && exit 1
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && steps.check_files.outputs.files_exists == 'true'
with:
files: "*.tar.gz"

0 comments on commit c68c276

Please sign in to comment.