Skip to content

Commit 11e70f6

Browse files
committed
workflow(integration): rearrangement of jobs and rework on regex (check commit messages)
1 parent 54cc94a commit 11e70f6

1 file changed

Lines changed: 26 additions & 21 deletions

File tree

.github/workflows/integration.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ on:
1111

1212
jobs:
1313

14+
# Check commits messages
15+
check-commit-message:
16+
name: Check Commit Message
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check Commit Type
20+
uses: gsactions/commit-message-checker@v2
21+
env:
22+
type: 'feat|feature|features|fix|perf|revert|doc|docs|refactor|refacto|refactoring|test|tests|chore|rename|workflow|example|examples|others'
23+
with:
24+
# Regex
25+
# group1: type - group2: scope (without '(' and ')') - group3: subject (no capital on first letter, no '.' at the end) - group4: body and footer
26+
# OR 'release' with version number
27+
pattern: '^(${{ env.type }})(?:\(([\w\-\.]+)\))?: ((?![A-Z])[^\r\n\f]*[^.\r\n\f])(?:[\r\n\f]([\s\S]*))?|release v\d+.\d+.\d+$'
28+
error: 'One or several of the pushed commits do not match the conventional commit convention. Please read CONTRIBUTING.md.'
29+
excludeDescription: true
30+
excludeTitle: true
31+
checkAllCommitMessages: true
32+
accessToken: ${{ secrets.GITHUB_TOKEN }}
33+
1434
# Build bundle, doc and check linter
1535
build:
1636
name: Build bundle, check Linter and generate documentation
@@ -58,22 +78,6 @@ jobs:
5878
examples
5979
buildDocs
6080
61-
62-
# Check commits messages
63-
check-commit-message:
64-
name: Check Commit Message
65-
runs-on: ubuntu-latest
66-
steps:
67-
- name: Check Commit Type
68-
uses: gsactions/commit-message-checker@v2
69-
with:
70-
pattern: '^(feat|feature|features|fix|perf|revert|doc|docs|refactor|refacto|refactoring|test|tests|chore|rename|workflow|example|examples|others)(\([\w\-\.]+\))?: ([\w ])+([\s\S]*)|release v\d+.\d+.\d+'
71-
error: 'One or several of the pushed commits do not match the conventional commit convention. Please read CONTRIBUTING.md.'
72-
excludeDescription: true
73-
excludeTitle: true
74-
checkAllCommitMessages: true
75-
accessToken: ${{ secrets.GITHUB_TOKEN }}
76-
7781
# Typecheck
7882
typecheck:
7983
name: Typecheck
@@ -96,7 +100,7 @@ jobs:
96100
# Unit and coverage tests
97101
unit-and-coverage-tests:
98102
name: Unit and coverage tests
99-
needs: [build, check-commit-message]
103+
needs: build
100104
runs-on: ubuntu-latest
101105
strategy:
102106
matrix:
@@ -137,7 +141,7 @@ jobs:
137141

138142
# Final Code coverage
139143
finish-coverage:
140-
name: finish parallel test unit
144+
name: close parallel unit tests coverall
141145
needs: unit-and-coverage-tests
142146
runs-on: ubuntu-latest
143147
steps:
@@ -146,6 +150,7 @@ jobs:
146150
with:
147151
parallel-finished: true
148152
github-token: ${{ secrets.GITHUB_TOKEN }}
153+
149154
# Functional tests
150155
functional-tests:
151156
name: Functional tests
@@ -179,7 +184,7 @@ jobs:
179184
publish:
180185
name: Publish NPM package
181186
if: ${{ github.ref == 'refs/heads/master' }}
182-
needs: [finish-coverage, functional-tests]
187+
needs: [check-commit-message, typecheck, finish-coverage, functional-tests]
183188
runs-on: ubuntu-latest
184189
permissions:
185190
# id-token: write permission is required for npm provenance:
@@ -233,7 +238,7 @@ jobs:
233238
deploy:
234239
name: Deploy to itowns.github.io
235240
if: ${{ github.ref == 'refs/heads/master' }}
236-
needs: [finish-coverage, functional-tests]
241+
needs: [check-commit-message, typecheck, finish-coverage, functional-tests]
237242
runs-on: ubuntu-latest
238243
steps:
239244

@@ -294,7 +299,7 @@ jobs:
294299
release:
295300
name: Release GitHub
296301
if: ${{ github.ref == 'refs/heads/master' && startsWith( github.event.head_commit.message, 'release v' ) }}
297-
needs: [finish-coverage, functional-tests]
302+
needs: [check-commit-message, typecheck, finish-coverage, functional-tests]
298303
runs-on: ubuntu-latest
299304
steps:
300305

0 commit comments

Comments
 (0)