-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…ttps://stackoverflow.com/questions/75318609/matrix-strategy-over-entire-workflow-in-github-actions/75337311#75337311 @ .github/workflows
- Loading branch information
Showing
6 changed files
with
174 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: be | ||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
required: true | ||
type: string | ||
defaults: | ||
run: | ||
working-directory: be | ||
jobs: | ||
phpstan: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/be | ||
- run: ./vendor/bin/phpstan analyse --error-format=github | ||
|
||
psalm: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/be | ||
- run: ./vendor/bin/psalm --output-format=github | ||
|
||
phpcs: | ||
runs-on: ${{ inputs.runs-on }} | ||
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: ${{ inputs.runs-on }} | ||
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: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/be | ||
- run: ./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle . | cs2pr | ||
|
||
phpmd: | ||
runs-on: ${{ inputs.runs-on }} | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: c# | ||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
required: true | ||
type: string | ||
defaults: | ||
run: | ||
working-directory: c# | ||
jobs: | ||
build: | ||
runs-on: ${{ inputs.runs-on }} | ||
strategy: | ||
matrix: | ||
project: [crawler, imagePipeline, shared, tbClient] | ||
fail-fast: false | ||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/c# | ||
- run: dotnet build --no-restore -c Release ${{ matrix.project }} | ||
|
||
ReSharper: | ||
runs-on: ${{ inputs.runs-on }} | ||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/c# | ||
|
||
- id: cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
${{ github.workspace }}/.resharper | ||
~/.dotnet/tools | ||
key: ${{ runner.os }}-resharper | ||
restore-keys: ${{ runner.os }}-resharper- | ||
|
||
- uses: muno92/resharper_inspectcode@v1 | ||
with: | ||
version: 2024.* | ||
minimumReportSeverity: info | ||
minimumSeverity: warning | ||
solutionPath: c#/tbm.sln | ||
cachesHome: ${{ github.workspace }}/.resharper | ||
|
||
# https://github.com/actions/runner/issues/1478 | ||
- uses: actions/cache/save@v4 | ||
if: always() && steps.cache-restore.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
${{ github.workspace }}/.resharper | ||
~/.dotnet/tools | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: fe | ||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
required: true | ||
type: string | ||
defaults: | ||
run: | ||
working-directory: fe | ||
jobs: | ||
tsc: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: yarn run vue-tsc | ||
|
||
eslint: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: yarn run eslint src | ||
|
||
codechecks: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: # contains CVE that triggers Dependabot | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: | | ||
yarn add -D typecov @codechecks/client | ||
yarn run codechecks ../.github/codechecks.yml | ||
env: | ||
CC_SECRET: ${{ secrets.CC_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,14 @@ | ||
# https://stackoverflow.com/questions/75318609/matrix-strategy-over-entire-workflow-in-github-actions/75337311#75337311 | ||
name: be | ||
on: | ||
push: | ||
paths: [be/**] | ||
defaults: | ||
run: | ||
working-directory: be | ||
jobs: | ||
phpstan: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/be | ||
- run: ./vendor/bin/phpstan analyse --error-format=github | ||
|
||
psalm: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/be | ||
- run: ./vendor/bin/psalm --output-format=github | ||
|
||
phpcs: | ||
runs-on: [ubuntu-latest, windows-latest, macos-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, windows-latest, macos-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, windows-latest, macos-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, windows-latest, macos-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 | ||
build: | ||
strategy: | ||
matrix: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
fail-fast: false | ||
uses: ./.github/baseflows/be.yml | ||
with: | ||
runs-on: ${{ matrix.runs-on }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,14 @@ | ||
# https://stackoverflow.com/questions/75318609/matrix-strategy-over-entire-workflow-in-github-actions/75337311#75337311 | ||
name: c# | ||
on: | ||
push: | ||
paths: [c#/**] | ||
defaults: | ||
run: | ||
working-directory: c# | ||
jobs: | ||
build: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
strategy: | ||
matrix: | ||
project: [crawler, imagePipeline, shared, tbClient] | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
fail-fast: false | ||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/c# | ||
- run: dotnet build --no-restore -c Release ${{ matrix.project }} | ||
|
||
ReSharper: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
env: | ||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/c# | ||
|
||
- id: cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
${{ github.workspace }}/.resharper | ||
~/.dotnet/tools | ||
key: ${{ runner.os }}-resharper | ||
restore-keys: ${{ runner.os }}-resharper- | ||
|
||
- uses: muno92/resharper_inspectcode@v1 | ||
with: | ||
version: 2024.* | ||
minimumReportSeverity: info | ||
minimumSeverity: warning | ||
solutionPath: c#/tbm.sln | ||
cachesHome: ${{ github.workspace }}/.resharper | ||
|
||
# https://github.com/actions/runner/issues/1478 | ||
- uses: actions/cache/save@v4 | ||
if: always() && steps.cache-restore.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
${{ github.workspace }}/.resharper | ||
~/.dotnet/tools | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} | ||
uses: ./.github/baseflows/c#.yml | ||
with: | ||
runs-on: ${{ matrix.runs-on }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
# https://stackoverflow.com/questions/75318609/matrix-strategy-over-entire-workflow-in-github-actions/75337311#75337311 | ||
name: fe | ||
on: | ||
push: | ||
paths: [fe/**] | ||
defaults: | ||
run: | ||
working-directory: fe | ||
jobs: | ||
tsc: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: yarn run vue-tsc | ||
|
||
eslint: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: yarn run eslint src | ||
|
||
codechecks: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: # contains CVE that triggers Dependabot | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/fe | ||
- run: | | ||
yarn add -D typecov @codechecks/client | ||
yarn run codechecks ../.github/codechecks.yml | ||
env: | ||
CC_SECRET: ${{ secrets.CC_SECRET }} | ||
build: | ||
strategy: | ||
matrix: | ||
runs-on: [ubuntu-latest, windows-latest, macos-latest] | ||
fail-fast: false | ||
uses: ./.github/baseflows/fe.yml | ||
with: | ||
runs-on: ${{ matrix.runs-on }} |