Skip to content

Commit 2a208e8

Browse files
committed
ci(checks): from dev yml to check yml
1 parent dcdca19 commit 2a208e8

File tree

2 files changed

+133
-143
lines changed

2 files changed

+133
-143
lines changed

.github/workflows/dev.yml

Lines changed: 6 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -34,76 +34,6 @@ jobs:
3434
with:
3535
runall: true
3636

37-
branch-name-check:
38-
name: Enforce Branch Name Convention
39-
if: success() || failure()
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Validate Branch Name
43-
run: |
44-
#BRANCH_NAME="${GITHUB_HEAD_REF}"
45-
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
46-
echo "Validating branch name: $BRANCH_NAME"
47-
48-
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
49-
echo "✅ Branch name is valid"
50-
else
51-
echo "❌ Invalid branch name: $BRANCH_NAME"
52-
echo "Branch names must follow one of the allowed prefixes:"
53-
echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*"
54-
exit 1
55-
fi
56-
continue-on-error: false
57-
58-
commitlint:
59-
runs-on: ubuntu-latest
60-
if: success() || failure()
61-
steps:
62-
- uses: actions/checkout@v4
63-
with:
64-
fetch-depth: 0
65-
- uses: wagoid/commitlint-github-action@v5
66-
with:
67-
configFile: .commitlintrc.json
68-
continue-on-error: false
69-
70-
# Global and better as prehook
71-
# gitguardian-scan:
72-
# runs-on: ubuntu-latest
73-
# if: success() || failure()
74-
# steps:
75-
# - uses: actions/checkout@v3
76-
77-
# - name: GitGuardian Scan
78-
# uses: GitGuardian/gg-shield-action@v1
79-
# env:
80-
# GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
81-
# continue-on-error: false
82-
83-
Unit-Tests:
84-
runs-on: ubuntu-latest
85-
if: success() || failure()
86-
steps:
87-
- name: See other project pipeline for Tests
88-
run: echo " See other project pipeline for Tests this is a placeholder"
89-
continue-on-error: false
90-
91-
92-
E2E-Tests:
93-
runs-on: ubuntu-latest
94-
if: success() || failure()
95-
steps:
96-
- name: See other project pipeline for Tests
97-
run: echo " See other project pipeline for Tests this is a placeholder"
98-
continue-on-error: false
99-
100-
Code-Coverage:
101-
runs-on: ubuntu-latest
102-
if: success() || failure()
103-
steps:
104-
- name: See other project pipeline for Tests
105-
run: echo " See other project pipeline for Tests this is a placeholder"
106-
continue-on-error: false
10737

10838
# Now we've done due diligence
10939
# The checks have been allowed to run if the workflow fails so if there a multiple fails we know.
@@ -226,12 +156,15 @@ jobs:
226156
run: npm ci
227157
#CI is an install that adheres to package-lock
228158

229-
- name: Build BlazorComponentLibrary (it publishes on build)
159+
- name: Build TELBlazor.Components (it publishes on build)
160+
env:
161+
DISABLE_PACKAGE_GENERATION: false
230162
run: |
231-
dotnet build Package.BlazorComponentLibrary -c Release \
163+
dotnet build TELBlazor.Components -c Release \
232164
/p:TELBlazorPackageVersion=$DEV_TELBLAZOR_PACKAGE_VERSION \
233165
/p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
234-
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE
166+
/p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
167+
/p:DisablePackageGeneration=$DISABLE_PACKAGE_GENERATION
235168
236169
- name: Publish to TechnologyEnhancedLearning as a Dev Package
237170
run: |
Lines changed: 127 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#qqqq to do refactor to here
22

3-
4-
53
name: Reusable CI Checks
64

75
on:
@@ -22,8 +20,66 @@ jobs:
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
@@ -32,7 +88,7 @@ jobs:
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

Comments
 (0)