Skip to content

Commit 205be2c

Browse files
committed
chore(ci): add commitlint step to checks
Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): dereference git branches Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): debug git dir Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): fetch refs Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): fix commitlint Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): remove cat Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): git fetch all Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): ffs Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): ffs 2 Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> chore(ci): fix commitlint step Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]>
1 parent ca1a808 commit 205be2c

File tree

1 file changed

+45
-20
lines changed

1 file changed

+45
-20
lines changed

.github/workflows/checks.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,28 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14+
commit-lint:
15+
name: Lint commits
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version-file: .nvmrc
25+
cache: npm
26+
- name: Install package dependencies
27+
run: npm ci
28+
- name: Run commitlint
29+
run: npx commitlint --from=origin/$GITHUB_BASE_REF
1430
lint:
15-
name: Lint
31+
name: Lint code
1632
runs-on: ubuntu-latest
1733
steps:
18-
- uses: actions/checkout@v3
34+
- name: Checkout
35+
uses: actions/checkout@v3
1936
- uses: actions/setup-node@v3
2037
with:
2138
node-version-file: .nvmrc
@@ -28,7 +45,8 @@ jobs:
2845
name: Build check
2946
runs-on: ubuntu-latest
3047
steps:
31-
- uses: actions/checkout@v3
48+
- name: Checkout
49+
uses: actions/checkout@v3
3250
- uses: actions/setup-node@v3
3351
with:
3452
node-version-file: .nvmrc
@@ -40,8 +58,13 @@ jobs:
4058
test-units-and-cover:
4159
name: Unit Tests And Coverage
4260
runs-on: ubuntu-latest
61+
needs:
62+
- commit-lint
63+
- lint
64+
- build-check
4365
steps:
44-
- uses: actions/checkout@v3
66+
- name: Checkout
67+
uses: actions/checkout@v3
4568
- uses: actions/setup-node@v3
4669
with:
4770
node-version-file: .nvmrc
@@ -70,11 +93,12 @@ jobs:
7093
name: Integration Tests and Coverage
7194
runs-on: ubuntu-latest
7295
needs:
96+
- commit-lint
7397
- lint
7498
- build-check
75-
- test-units-and-cover
7699
steps:
77-
- uses: actions/checkout@v3
100+
- name: Checkout
101+
uses: actions/checkout@v3
78102
- uses: actions/setup-node@v3
79103
with:
80104
node-version-file: .nvmrc
@@ -107,18 +131,19 @@ jobs:
107131
needs: [test-units-and-cover, test-integrations-and-cover]
108132
runs-on: ubuntu-latest
109133
steps:
110-
- uses: actions/checkout@v3
111-
with:
112-
fetch-depth: 0
113-
- uses: actions/download-artifact@v3
114-
name: Download unit & integration coverage reports
115-
with:
116-
path: .coverage
117-
- name: SonarCloud Scan
118-
uses: sonarsource/sonarcloud-github-action@master
119-
env:
120-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
134+
- name: Checkout
135+
uses: actions/checkout@v3
136+
with:
137+
fetch-depth: 0
138+
- uses: actions/download-artifact@v3
139+
name: Download unit & integration coverage reports
140+
with:
141+
path: .coverage
142+
- name: SonarCloud Scan
143+
uses: sonarsource/sonarcloud-github-action@master
144+
env:
145+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
122147
post-tests:
123148
name: Post Tests
124149
needs: [test-units-and-cover, test-integrations-and-cover]
@@ -133,14 +158,14 @@ jobs:
133158
release:
134159
name: Release
135160
runs-on: ubuntu-latest
136-
needs: [test-integrations-and-cover]
161+
needs: [test-units-and-cover, test-integrations-and-cover]
137162
if: github.ref == 'refs/heads/main'
138163
environment: release
139164
env:
140165
TELEGRAM_BOT_ID: ${{ secrets.TELEGRAM_BOT_ID }}
141166
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
142167
steps:
143-
- name: Checkout repository
168+
- name: Checkout
144169
uses: actions/checkout@v3
145170
- uses: actions/setup-node@v3
146171
with:

0 commit comments

Comments
 (0)