Skip to content

Commit

Permalink
(chore): apply skeleton package changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ictbeheer committed Jan 15, 2025
1 parent 9423d04 commit 3373e96
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 341 deletions.
12 changes: 5 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4

[*.blade.php]
indent_size = 2
indent_style = space
32 changes: 0 additions & 32 deletions .github/labeler.yml

This file was deleted.

65 changes: 4 additions & 61 deletions .github/workflows/badges.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create badges
name: Create Badges

on:
release:
Expand All @@ -10,63 +10,6 @@ permissions:
pull-requests: write

jobs:
badges:
name: Create badges
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@2.9.0
with:
php-version: '8.1'
extensions: simplexml, dom, xml, xdebug, intl
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Recreate autoload file
run: composer dump-autoload

- name: Run Unit Tests
run: XDEBUG_MODE_COVERAGE=coverage vendor/bin/pest --coverage-clover=clover.xml

- name: Make lines of code badge
uses: DeathSy/GHA-LoC-Badge@1.0.3
id: badge
with:
debug: true
directory: ./src
patterns: '**/*.php'
badge: ./output/lines-of-code.svg

- name: Make code coverage badge
uses: timkrase/phpunit-coverage-badge@v1.2.1
with:
coverage_badge_path: output/coverage.svg
push_badge: false

- name: Git push to badges branch
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./output
publish_branch: badges
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
composer-diff:
uses: yardinternet/workflows/.github/workflows/badges.yml@main
secrets: inherit
30 changes: 3 additions & 27 deletions .github/workflows/composer-lock-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,8 @@ on:
pull_request:
paths:
- 'composer.lock'

jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to make it possible to compare with PR base branch

- name: Generate composer diff
id: composer_diff # To reference the output in comment
uses: IonBazan/composer-diff-action@v1

- uses: marocchino/sticky-pull-request-comment@v2
# An empty diff result will break this action.
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
header: composer-diff # Creates a collapsed comment with the report
message: |
<details>
<summary>Composer package changes</summary>
${{ steps.composer_diff.outputs.composer_diff }}
</details>
uses: yardinternet/workflows/.github/workflows/composer-lock-diff.yml@main
secrets: inherit
20 changes: 3 additions & 17 deletions .github/workflows/format-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@ on:
- '**.php'

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '(auto): apply php-cs-fixer changes'
push_options: '--force'
env:
GITHUB_TOKEN: ${{ secrets.YARD_BOT_PAT }}
php-cs-fixer:
uses: yardinternet/workflows/.github/workflows/format-php.yml@main
secrets: inherit
20 changes: 0 additions & 20 deletions .github/workflows/labeler.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/markdown-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Markdown Linting
on:
pull_request:
paths:
- '**.md'

jobs:
linting:
uses: yardinternet/workflows/.github/workflows/markdown-linting.yml@main
secrets: inherit
15 changes: 2 additions & 13 deletions .github/workflows/npm-lock-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,5 @@ on:

jobs:
lockfile_changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to make it possible to compare with PR base branch
- name: NPM Lockfile Changes
uses: codepunkt/npm-lockfile-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
uses: yardinternet/workflows/.github/workflows/npm-lock-diff.yml@main
secrets: inherit
29 changes: 3 additions & 26 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ on:
- '.github/workflows/phpstan.yml'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }}

- name: Install composer dependencies
run: composer install --prefer-dist --no-interaction

- name: Dirty fix for previously defined function
run: sed -i -e 's#function __(#function ____(#' ./vendor/php-stubs/wordpress-stubs/wordpress-stubs.php

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
phpstan:
uses: yardinternet/workflows/.github/workflows/phpstan.yml@main
secrets: inherit
61 changes: 6 additions & 55 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,9 @@ on:

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
laravel: [10.*]
include:
- laravel: 10.*
testbench: 8.*

name: PHP${{ matrix.php }} - Laravel${{ matrix.laravel }}

permissions:
contents: read
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, xdebug
coverage: xdebug
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.YARD_BOT_PAT }}

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction
- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
run: vendor/bin/pest --coverage-clover=coverage.xml

- name: Coverage Report as Comment (Clover)
if: github.event_name == 'pull_request'
uses: lucassabreu/comment-coverage-clover@main
with:
file: coverage.xml
uses: yardinternet/workflows/.github/workflows/run-laravel-testbench-tests.yml@main
with:
php-versions: '["8.1","8.2"]'
laravel-versions: '["10.*"]'
testbench-versions: '["8.*"]'
secrets: inherit
6 changes: 6 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MD010: { "spaces_per_tab": 4 }
MD013: false
MD024: { "siblings_only": true }
MD025: false
MD033: false
MD036: false
Loading

0 comments on commit 3373e96

Please sign in to comment.