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 33424ba
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/actions/be/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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
# https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#jit-configuration
coverage: none
ini-values: opcache.enable_cli=1
env: # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#force-update-setup
update: 'true'
# https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#cache-composer-dependencies
- 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('be/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- run: composer install --prefer-dist
working-directory: be
shell: bash
3 changes: 2 additions & 1 deletion .github/actions/c#/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ runs:
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
with: # https://github.com/actions/setup-dotnet/tree/v4
dotnet-version: 7
cache: true
# https://github.com/actions/setup-node/issues/624#issuecomment-1328681525
cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json
- run: dotnet new globaljson --sdk-version 7.0.405
working-directory: c#
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/fe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ runs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
with: # https://github.com/actions/setup-node/tree/v4
node-version: lts/*
cache: yarn
# https://github.com/actions/setup-node/issues/624#issuecomment-1328681525
cache-dependency-path: ${{ github.workspace }}/fe/yarn.lock
- name: install
run: yarn install --immutable
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/be.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
# https://github.com/staabm/annotate-pull-request-from-checkstyle
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 # https://github.com/phpmd/phpmd/issues/506
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 33424ba

Please sign in to comment.