-
Notifications
You must be signed in to change notification settings - Fork 719
87 lines (83 loc) · 3.03 KB
/
Copy pathmain.yml
File metadata and controls
87 lines (83 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI/CD for EC-CUBE
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rector:
uses: ./.github/workflows/rector.yml
phpstan:
uses: ./.github/workflows/phpstan.yml
php-cs-fixer:
uses: ./.github/workflows/php-cs-fixer.yml
unit-test:
needs: [ rector, phpstan, php-cs-fixer ]
uses: ./.github/workflows/unit-test.yml
e2e-test:
needs: [ rector, phpstan, php-cs-fixer ]
uses: ./.github/workflows/e2e-test.yml
# PR/push では最新 PHP のみ。全バージョンは weekly-test.yml が週次で回す
with:
php-versions: "['8.5']"
agentic-commerce-e2e:
# plugin-test と並列で実行する (同じ needs)。
needs: [ unit-test, e2e-test ]
# 本体 ↔ eccube-api4 ↔ sample-payment-plugin の結合 E2E。
# 依存プラグインは fork の feature/agentic-commerce を既定参照 (org 移行後に別 PR で差し替え)。
uses: ./.github/workflows/agentic-commerce-e2e.yml
dockerbuild:
uses: ./.github/workflows/dockerbuild.yml
permissions:
contents: read
packages: write
plugin-test:
needs: [ unit-test, e2e-test ]
uses: ./.github/workflows/plugin-test.yml
with:
php-versions: "['8.5']"
e2e-test-throttling:
needs: [ plugin-test ]
uses: ./.github/workflows/e2e-test-throttling.yml
with:
php-versions: "['8.5']"
# deny-test:
# needs: [ plugin-test ]
# uses: ./.github/workflows/deny-test.yml
success:
# 全ジョブを直接 needs する。チェーン依存(success←throttling←plugin-test←unit-test)だと
# 上流の failure が各ホップで skipped に化けて末端へ届かず、必須チェック success が
# skipped=パス扱いとなって赤テストのまま auto-merge されてしまうため(#6840)。
needs: [ rector, phpstan, php-cs-fixer, unit-test, e2e-test, plugin-test, e2e-test-throttling, dockerbuild, agentic-commerce-e2e ]
# 上流が失敗しても success 自体は必ず実行する(skip させない)
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# skipped は許容(dependabot の coverage 等、正当な skip がある)。
# failure / cancelled のみを赤として扱い、auto-merge をブロックする。
- name: Check required jobs
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: echo "::error::required job failed or was cancelled" && exit 1
- name: success
run: echo "::notice::success!"
coverage:
needs: [ unit-test ] # PHPUnit coverage only, no need to wait for e2e-test
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
permissions:
contents: read
code-quality: write
secrets: inherit # Codecov アップロードに CODECOV_TOKEN が必要
uses: ./.github/workflows/coverage.yml