From c68c2764975df21df2167aa22dc8cdc1c7409787 Mon Sep 17 00:00:00 2001 From: mutec Date: Sun, 5 Jan 2025 14:45:31 +0100 Subject: [PATCH] update github actions --- .github/workflows/codestyle.yml | 35 +++++++++++++++--------------- .github/workflows/php.yml | 34 ++++++++++++++--------------- .github/workflows/pull_request.yml | 20 ++++++++--------- .github/workflows/release.yml | 4 ++-- 4 files changed, 47 insertions(+), 46 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 0dc9ad8..b03356f 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -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 diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3d1a7f9..9885479 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 45b8df9..08aed6d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1691ede..7f676f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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"