Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Jun 13, 2024
1 parent b90ec18 commit d62d880
Show file tree
Hide file tree
Showing 12 changed files with 803 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: 🏷️ Add labels

jobs:
label:
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@v3.1.1
with:
os: ubuntu-latest
secrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master

permissions:
pull-requests: write
Expand All @@ -13,7 +15,7 @@ name: 🤞 Auto merge release

jobs:
auto-merge:
uses: wayofdev/gh-actions/.github/workflows/auto-merge-release.yml@master
uses: wayofdev/gh-actions/.github/workflows/auto-merge-release.yml@v3.1.1
with:
os: ubuntu-latest
pull-request-number: ${{ github.event.pull_request.number }}
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/ci.yml

This file was deleted.

200 changes: 200 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
---

on: # yamllint disable-line rule:truthy
pull_request:
branches:
- master

name: 🧹 Fix PHP coding standards

jobs:
commit-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: commit-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
permissions:
contents: read
pull-requests: read
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint commits using "commitlint"
uses: wagoid/[email protected]
with:
configFile: ${{ github.workspace }}/.github/.commitlint.config.mjs
failOnWarnings: false
failOnErrors: true
helpURL: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'

yaml-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: yaml-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
permissions:
contents: read
pull-requests: read
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint YAML files
uses: ibiqlik/[email protected]
with:
config_file: .github/.yamllint.yaml
file_or_dir: '.'
strict: true

markdown-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: markdown-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🧐 Lint Markdown files
uses: DavidAnson/[email protected]
with:
config: '.github/.markdownlint.json'
globs: |
**/*.md
!CHANGELOG.md
composer-linting:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: composer-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
strategy:
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
permissions:
contents: write
steps:
- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, phar, fileinfo, curl
ini-values: error_reporting=E_ALL
coverage: none
tools: phive

- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 📥 Install dependencies with phive
uses: wayofdev/gh-actions/actions/phive/[email protected]
with:
phive-home: '.phive'
trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D

- name: 🔍 Run ergebnis/composer-normalize
run: .phive/composer-normalize --ansi --dry-run

coding-standards:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: coding-standards-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
strategy:
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
permissions:
contents: write
steps:
- name: ⚙️ Set git to use LF line endings
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, curl
ini-values: error_reporting=E_ALL
coverage: none

- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 🛠️ Prepare environment
run: make prepare

- name: 🚨 Run coding standards task
run: composer cs:fix
env:
PHP_CS_FIXER_IGNORE_ENV: true

- name: 📤 Commit and push changed files back to GitHub
uses: stefanzweifel/[email protected]
with:
commit_message: 'style(php-cs-fixer): lint php files and fix coding standards'
branch: ${{ github.head_ref }}
commit_author: 'github-actions <[email protected]>'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/create-arch-diagram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions: read-all

jobs:
codesee:
uses: wayofdev/gh-actions/.github/workflows/create-arch-diagram.yml@master
uses: wayofdev/gh-actions/.github/workflows/create-arch-diagram.yml@v3.1.1
with:
os: ubuntu-latest
continue-on-error: true
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
# https://github.com/google-github-actions/release-please-action#release-types-supported
# https://github.com/googleapis/release-please/blob/main/docs/customizing.md

on: # yamllint disable-line rule:truthy
push:
Expand All @@ -12,12 +13,15 @@ name: 📦 Create release

jobs:
release:
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
with:
os: ubuntu-latest
branch: master
package-name: laravel-paginator
secrets:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: 🎉 Create release
uses: googleapis/[email protected]
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
config-file: .github/.release-please-config.json
manifest-file: .github/.release-please-manifest.json
target-branch: master

...
Loading

0 comments on commit d62d880

Please sign in to comment.