Skip to content

Commit aad17bb

Browse files
authored
chore(ci): add specs lint job (#66)
1 parent cc57be8 commit aad17bb

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

.github/actions/cache/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Restore cached dependencies.
44

55
inputs:
66
job:
7-
description: 'The job that requires this composite'
7+
description: The job that requires this composite
88
required: true
99

1010
runs:

.github/actions/setup/action.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,47 +54,47 @@ runs:
5454
outputs:
5555
# specs variables
5656
RUN_SPECS_SEARCH:
57-
description: 'Determine if the `specs_search` job should run'
57+
description: Determine if the `specs_search` job should run
5858
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.SEARCH_SPECS_CHANGED > 0 }}
5959
RUN_SPECS_RECOMMEND:
60-
description: 'Determine if the `specs_recommend` job should run'
60+
description: Determine if the `specs_recommend` job should run
6161
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.RECOMMEND_SPECS_CHANGED > 0 }}
6262
RUN_SPECS_QS:
63-
description: 'Determine if the `specs_qs` job should run'
63+
description: Determine if the `specs_qs` job should run
6464
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.QS_SPECS_CHANGED > 0 }}
6565
RUN_SPECS_PERSO:
66-
description: 'Determine if the `specs_perso` job should run'
66+
description: Determine if the `specs_perso` job should run
6767
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.PERSO_SPECS_CHANGED > 0 }}
6868
RUN_SPECS_INSIGHTS:
69-
description: 'Determine if the `specs_insights` job should run'
69+
description: Determine if the `specs_insights` job should run
7070
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.INSIGHTS_SPECS_CHANGED > 0 }}
7171
RUN_SPECS_ANALYTICS:
72-
description: 'Determine if the `specs_analytics` job should run'
72+
description: Determine if the `specs_analytics` job should run
7373
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.ANALYTICS_SPECS_CHANGED > 0 }}
7474
RUN_SPECS_AB:
75-
description: 'Determine if the `specs_ab` job should run'
75+
description: Determine if the `specs_ab` job should run
7676
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.AB_SPECS_CHANGED > 0 }}
7777

7878
# js client variables
7979
RUN_JS_CLIENT_SEARCH:
80-
description: 'Determine if the `client_javascript_search` job should run'
80+
description: Determine if the `client_javascript_search` job should run
8181
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.SEARCH_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.JS_SEARCH_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 }}
8282
RUN_JS_CLIENT_RECOMMEND:
83-
description: 'Determine if the `client_javascript_recommend` job should run'
83+
description: Determine if the `client_javascript_recommend` job should run
8484
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.RECOMMEND_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.JS_RECOMMEND_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 }}
8585
RUN_JS_CLIENT_PERSO:
86-
description: 'Determine if the `client_javascript_perso` job should run'
86+
description: Determine if the `client_javascript_perso` job should run
8787
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.PERSO_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.JS_PERSO_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 }}
8888
RUN_JS_CLIENT_ANALYTICS:
89-
description: 'Determine if the `client_javascript_analytics` job should run'
89+
description: Determine if the `client_javascript_analytics` job should run
9090
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.ANALYTICS_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.JS_ANALYTICS_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 }}
9191

9292
# java client variables
9393
RUN_JAVA_CLIENT:
94-
description: 'Determine if the `client_java_*` job should run'
94+
description: Determine if the `client_java_*` job should run
9595
value: ${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.SEARCH_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.JAVA_CLIENT_CHANGED > 0 || steps.diff.outputs.JAVA_TEMPLATE_CHANGED > 0 }}
9696

9797
# cts variables
9898
RUN_CTS:
99-
description: 'Determine if the `cts` job should run'
99+
description: Determine if the `cts` job should run
100100
value: ${{ github.ref_name == 'main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SPECS_CHANGED > 0 || steps.diff.outputs.TESTS_CHANGED > 0 || steps.diff.outputs.JS_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 || steps.diff.outputs.JAVA_CLIENT_CHANGED > 0 || steps.diff.outputs.JAVA_TEMPLATE_CHANGED > 0 }}

.github/workflows/check.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Setup
2323
id: setup
2424
uses: ./.github/actions/setup
25+
26+
- name: Lint GitHub actions
27+
run: yarn eslint --ext=yml .github/actions .github/workflows
2528
outputs:
2629
RUN_SPECS_SEARCH: ${{ steps.setup.outputs.RUN_SPECS_SEARCH }}
2730
RUN_SPECS_RECOMMEND: ${{ steps.setup.outputs.RUN_SPECS_RECOMMEND }}
@@ -53,6 +56,9 @@ jobs:
5356
- name: Checking search specs
5457
run: yarn build:specs search
5558

59+
- name: Lint search specs
60+
run: yarn eslint --ext=yml specs/search
61+
5662
specs_recommend:
5763
runs-on: ubuntu-20.04
5864
needs: setup
@@ -66,6 +72,9 @@ jobs:
6672
- name: Checking recommend specs
6773
run: yarn build:specs recommend
6874

75+
- name: Lint recommend specs
76+
run: yarn eslint --ext=yml specs/recommend
77+
6978
specs_perso:
7079
runs-on: ubuntu-20.04
7180
needs: setup
@@ -79,6 +88,9 @@ jobs:
7988
- name: Checking personalization specs
8089
run: yarn build:specs personalization
8190

91+
- name: Lint personalization specs
92+
run: yarn eslint --ext=yml specs/personalization
93+
8294
specs_analytics:
8395
runs-on: ubuntu-20.04
8496
needs: setup
@@ -92,6 +104,9 @@ jobs:
92104
- name: Checking analytics specs
93105
run: yarn build:specs analytics
94106

107+
- name: Lint analytics specs
108+
run: yarn eslint --ext=yml specs/analytics
109+
95110
client_javascript_search:
96111
runs-on: ubuntu-20.04
97112
needs: [specs_search]
@@ -222,13 +237,12 @@ jobs:
222237
cts:
223238
runs-on: ubuntu-20.04
224239
needs:
225-
[
226-
client_javascript_search,
227-
client_javascript_recommend,
228-
client_javascript_perso,
229-
client_javascript_analytics,
230-
client_java_search,
231-
]
240+
- client_javascript_search
241+
- client_javascript_recommend
242+
- client_javascript_perso
243+
- client_javascript_analytics
244+
- client_java_search
245+
232246
if: ${{ always() && needs.setup.outputs.RUN_CTS == 'true' }}
233247
steps:
234248
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)