Skip to content

Commit

Permalink
+ workflows/be.yml
Browse files Browse the repository at this point in the history
+ actions/be/action.yml
@ .github
  • Loading branch information
n0099 committed Feb 12, 2024
1 parent 44b9c8a commit 488e93f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/actions/be/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: be/init
description: be/init
runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: cs2pr
coverage: none
ini-values: opcache.enable_cli=1
env:
update: 'true'
- run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
working-directory: be
shell: bash
- id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
working-directory: be
shell: bash
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- run: composer install --prefer-dist
working-directory: be
shell: bash
50 changes: 50 additions & 0 deletions .github/workflows/be.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: be
on:
push:
#paths: [be/**]
defaults:
run:
working-directory: be
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: ./vendor/bin/phpstan analyse --error-format=github
psalm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: ./vendor/bin/psalm --output-format=github
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- id: run
run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml .
- if: always() && steps.run.outcome == 'failure'
run: cs2pr ./phpcs-report.xml
pint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- id: run
run: ./vendor/bin/pint --test
- if: failure() && steps.run.outcome != 'success'
run: ./vendor/bin/pint --test --format=checkstyle | cs2pr
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: ./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle . | cs2pr
phpmd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/be
- run: ./vendor/bin/phpmd . github cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor
3 changes: 1 addition & 2 deletions .github/workflows/c#.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/c#
- name: build
run: dotnet build --no-restore -c Debug ${{ matrix.project }}
- run: dotnet build --no-restore -c Debug ${{ matrix.project }}

0 comments on commit 488e93f

Please sign in to comment.