11# qqqq to do refactor to here
22
3-
4-
53name : Reusable CI Checks
64
75on :
2220 - name : See other project pipeline for Tests
2321 run : echo " See other project pipeline for Tests this is a placeholder"
2422
25- branch-name-check :
26- name : PR Check Enforce Branch Name Convention
23+ # branch-name-check:
24+ # name: PR Check Enforce Branch Name Convention
25+ # runs-on: ubuntu-latest
26+ # steps:
27+ # - name: Validate Branch Name
28+ # run: |
29+ # #BRANCH_NAME="${GITHUB_HEAD_REF}"
30+ # BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
31+ # echo "Validating branch name: $BRANCH_NAME"
32+
33+ # if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]] || [[ "$BRANCH_NAME" == "Automatic_version_update_dependabot" ]]; then
34+ # echo "✅ Branch name is valid"
35+ # else
36+ # echo "❌ Invalid branch name: $BRANCH_NAME"
37+ # echo "Branch names must follow one of the allowed prefixes:"
38+ # echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*"
39+ # exit 1
40+ # fi
41+ # continue-on-error: ${{ inputs.runall }}
42+
43+ # commitlint:
44+ # name: PR Check commitlint
45+ # runs-on: ubuntu-latest
46+ # steps:
47+ # - uses: actions/checkout@v4
48+ # with:
49+ # fetch-depth: 0
50+ # - uses: wagoid/commitlint-github-action@v5
51+ # with:
52+ # configFile: .commitlintrc.json
53+ # continue-on-error: ${{ inputs.runall }}
54+
55+ # Unit-Tests:
56+ # name: PR Check Unit Tests
57+ # runs-on: ubuntu-latest
58+ # steps:
59+ # - name: See other project pipeline for Tests
60+ # run: echo " See other project pipeline for Tests this is a placeholder"
61+ # continue-on-error: ${{ inputs.runall }}
62+
63+ # E2E-Tests:
64+ # name: PR Check E2E Tests
65+ # runs-on: ubuntu-latest
66+ # steps:
67+ # - name: See other project pipeline for Tests
68+ # run: echo " See other project pipeline for Tests this is a placeholder"
69+ # continue-on-error: ${{ inputs.runall }}
70+
71+ # Code-Coverage:
72+ # name: PR Check Code Coverage
73+ # runs-on: ubuntu-latest
74+ # steps:
75+ # - name: Code Coverage
76+ # run: echo "TODO Code Coverage"
77+ # continue-on-error: ${{ inputs.runall }}
78+
79+
80+ branch-name-check :
81+ name : Enforce Branch Name Convention
82+ if : success() || failure()
2783 runs-on : ubuntu-latest
2884 steps :
2985 - name : Validate Branch Name
3288 BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
3389 echo "Validating branch name: $BRANCH_NAME"
3490
35- if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]] || [[ "$BRANCH_NAME" == "Automatic_version_update_dependabot" ]] ; then
91+ if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]]; then
3692 echo "✅ Branch name is valid"
3793 else
3894 echo "❌ Invalid branch name: $BRANCH_NAME"
@@ -41,75 +97,76 @@ jobs:
4197 exit 1
4298 fi
4399 continue-on-error : ${{ inputs.runall }}
44-
45- commitlint :
46- name : PR Check commitlint
47- runs-on : ubuntu-latest
48- steps :
49- - uses : actions/checkout@v4
50- with :
51- fetch-depth : 0
52- - uses : wagoid/commitlint-github-action@v5
53- with :
54- configFile : .commitlintrc.json
55- continue-on-error : ${{ inputs.runall }}
56-
57- Unit-Tests :
58- name : PR Check Unit Tests
100+
101+ commitlint :
59102 runs-on : ubuntu-latest
103+ if : success() || failure()
60104 steps :
61- - name : See other project pipeline for Tests
62- run : echo " See other project pipeline for Tests this is a placeholder"
63- continue-on-error : ${{ inputs.runall }}
105+ - uses : actions/checkout@v4
106+ with :
107+ fetch-depth : 0
108+ - uses : wagoid/commitlint-github-action@v5
109+ with :
110+ configFile : .commitlintrc.json
111+ continue-on-error : ${{ inputs.runall }}
112+
113+ Unit-Tests :
114+ runs-on : ubuntu-latest
115+ if : success() || failure()
116+ steps :
117+ - name : See other project pipeline for Tests
118+ run : echo " See other project pipeline for Tests this is a placeholder"
119+ continue-on-error : ${{ inputs.runall }}
120+
64121
65- E2E-Tests :
66- name : PR Check E2E Tests
67- runs-on : ubuntu-latest
68- steps :
69- - name : See other project pipeline for Tests
70- run : echo " See other project pipeline for Tests this is a placeholder"
71- continue-on-error : ${{ inputs.runall }}
122+ E2E-Tests :
123+ runs-on : ubuntu-latest
124+ if : success() || failure()
125+ steps :
126+ - name : See other project pipeline for Tests
127+ run : echo " See other project pipeline for Tests this is a placeholder"
128+ continue-on-error : ${{ inputs.runall }}
129+
130+ Code-Coverage :
131+ runs-on : ubuntu-latest
132+ if : success() || failure()
133+ steps :
134+ - name : See other project pipeline for Tests
135+ run : echo " See other project pipeline for Tests this is a placeholder"
136+ continue-on-error : ${{ inputs.runall }}
72137
73- Code-Coverage :
74- name : PR Check Code Coverage
75- runs-on : ubuntu-latest
76- steps :
77- - name : Code Coverage
78- run : echo "TODO Code Coverage"
79- continue-on-error : ${{ inputs.runall }}
138+ Check-For-Fails :
139+ name : Fail check if running allowed
140+ if : ${{ inputs.runall }}
141+ needs :
142+ - solution-build
143+ - branch-name-check
144+ - commitlint
145+ - Unit-Tests
146+ - E2E-Tests
147+ - Code-Coverage
80148
81- Check-For-Fails :
82- name : Fail check if running allowed
83- if : ${{ inputs.runall }}
84- needs :
85- - solution-build
86- - branch-name-check
87- - commitlint
88- - Unit-Tests
89- - E2E-Tests
90- - Code-Coverage
91-
92- runs-on : ubuntu-latest
93- steps :
94- - name : Check-For-Fails
95- run : echo "TODO Code Coverage"
149+ runs-on : ubuntu-latest
150+ steps :
151+ - name : Check-For-Fails
152+ run : echo "TODO Code Coverage"
96153
97- - name : Check Job Results
98- run : |
99- echo "Solution Build: ${{ needs.solution-build.result }}"
100- echo "Branch Name Check: ${{ needs.branch-name-check.result }}"
101- echo "Commitlint: ${{ needs.commitlint.result }}"
102- echo "Unit Tests: ${{ needs.Unit-Tests.result }}"
103- echo "E2E Tests: ${{ needs.E2E-Tests.result }}"
104- echo "Code Coverage: ${{ needs.Code-Coverage.result }}"
154+ - name : Check Job Results
155+ run : |
156+ echo "Solution Build: ${{ needs.solution-build.result }}"
157+ echo "Branch Name Check: ${{ needs.branch-name-check.result }}"
158+ echo "Commitlint: ${{ needs.commitlint.result }}"
159+ echo "Unit Tests: ${{ needs.Unit-Tests.result }}"
160+ echo "E2E Tests: ${{ needs.E2E-Tests.result }}"
161+ echo "Code Coverage: ${{ needs.Code-Coverage.result }}"
105162
106- if [[ "${{ needs.solution-build.result }}" != "success" || \
107- "${{ needs.branch-name-check.result }}" != "success" || \
108- "${{ needs.commitlint.result }}" != "success" || \
109- "${{ needs.Unit-Tests.result }}" != "success" || \
110- "${{ needs.E2E-Tests.result }}" != "success" || \
111- "${{ needs.Code-Coverage.result }}" != "success" ]]; then
112- echo "❌ One or more jobs failed."
113- exit 1
114- fi
115- continue-on-error : false
163+ if [[ "${{ needs.solution-build.result }}" != "success" || \
164+ "${{ needs.branch-name-check.result }}" != "success" || \
165+ "${{ needs.commitlint.result }}" != "success" || \
166+ "${{ needs.Unit-Tests.result }}" != "success" || \
167+ "${{ needs.E2E-Tests.result }}" != "success" || \
168+ "${{ needs.Code-Coverage.result }}" != "success" ]]; then
169+ echo "❌ One or more jobs failed."
170+ exit 1
171+ fi
172+ continue-on-error : false
0 commit comments