Skip to content

Commit 61578b2

Browse files
committed
ci: add ESLint check as blocking step before tests
- Add lint.yml reusable workflow that runs yarn lint - Update tests.yml to call lint workflow first - All test jobs now depend on lint passing
1 parent 6566469 commit 61578b2

File tree

2 files changed

+37
-15
lines changed

2 files changed

+37
-15
lines changed

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
name: ESLint
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install dependencies
14+
uses: ./.github/actions/install-all-build-libs
15+
16+
- name: Run ESLint
17+
run: yarn lint
18+

.github/workflows/tests.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@ jobs:
7373
desktop:
7474
- 'redisinsight/desktop/**'
7575
76+
lint:
77+
uses: ./.github/workflows/lint.yml
78+
secrets: inherit
79+
7680
frontend-tests:
77-
needs: changes
81+
needs: [changes, lint]
7882
if: |
79-
startsWith(github.ref_name, 'fe/') ||
80-
startsWith(github.ref_name, 'fe-be/') ||
81-
startsWith(github.ref_name, 'feature/') ||
82-
startsWith(github.ref_name, 'bugfix/') ||
83+
startsWith(github.ref_name, 'fe/') ||
84+
startsWith(github.ref_name, 'fe-be/') ||
85+
startsWith(github.ref_name, 'feature/') ||
86+
startsWith(github.ref_name, 'bugfix/') ||
8387
startsWith(github.ref_name, 'ric/') ||
8488
contains(github.event.pull_request.labels.*.name, 'run-all-tests') ||
8589
contains(github.event.pull_request.labels.*.name, 'run-frontend-tests')
@@ -95,12 +99,12 @@ jobs:
9599
type: unit
96100

97101
backend-tests:
98-
needs: changes
102+
needs: [changes, lint]
99103
if: |
100-
startsWith(github.ref_name, 'be/') ||
101-
startsWith(github.ref_name, 'fe-be/') ||
102-
startsWith(github.ref_name, 'feature/') ||
103-
startsWith(github.ref_name, 'bugfix/') ||
104+
startsWith(github.ref_name, 'be/') ||
105+
startsWith(github.ref_name, 'fe-be/') ||
106+
startsWith(github.ref_name, 'feature/') ||
107+
startsWith(github.ref_name, 'bugfix/') ||
104108
startsWith(github.ref_name, 'ric/') ||
105109
contains(github.event.pull_request.labels.*.name, 'run-all-tests') ||
106110
contains(github.event.pull_request.labels.*.name, 'run-backend-tests')
@@ -116,12 +120,12 @@ jobs:
116120
type: unit
117121

118122
integration-tests:
119-
needs: changes
123+
needs: [changes, lint]
120124
if: |
121-
startsWith(github.ref_name, 'be/') ||
122-
startsWith(github.ref_name, 'fe-be/') ||
123-
startsWith(github.ref_name, 'feature/') ||
124-
startsWith(github.ref_name, 'bugfix/') ||
125+
startsWith(github.ref_name, 'be/') ||
126+
startsWith(github.ref_name, 'fe-be/') ||
127+
startsWith(github.ref_name, 'feature/') ||
128+
startsWith(github.ref_name, 'bugfix/') ||
125129
startsWith(github.ref_name, 'ric/') ||
126130
contains(github.event.pull_request.labels.*.name, 'run-all-tests') ||
127131
contains(github.event.pull_request.labels.*.name, 'run-integration-tests')

0 commit comments

Comments
 (0)