diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index c6a0db5f33..86f733c4c8 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -4,7 +4,7 @@ description: Restore cached dependencies. inputs: job: - description: 'The job that requires this composite' + description: The job that requires this composite required: true runs: diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 58dc08e778..fa2c370f4e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -54,47 +54,47 @@ runs: outputs: # specs variables RUN_SPECS_SEARCH: - description: 'Determine if the `specs_search` job should run' + description: Determine if the `specs_search` job should run 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 }} RUN_SPECS_RECOMMEND: - description: 'Determine if the `specs_recommend` job should run' + description: Determine if the `specs_recommend` job should run 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 }} RUN_SPECS_QS: - description: 'Determine if the `specs_qs` job should run' + description: Determine if the `specs_qs` job should run 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 }} RUN_SPECS_PERSO: - description: 'Determine if the `specs_perso` job should run' + description: Determine if the `specs_perso` job should run 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 }} RUN_SPECS_INSIGHTS: - description: 'Determine if the `specs_insights` job should run' + description: Determine if the `specs_insights` job should run 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 }} RUN_SPECS_ANALYTICS: - description: 'Determine if the `specs_analytics` job should run' + description: Determine if the `specs_analytics` job should run 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 }} RUN_SPECS_AB: - description: 'Determine if the `specs_ab` job should run' + description: Determine if the `specs_ab` job should run 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 }} # js client variables RUN_JS_CLIENT_SEARCH: - description: 'Determine if the `client_javascript_search` job should run' + description: Determine if the `client_javascript_search` job should run 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 }} RUN_JS_CLIENT_RECOMMEND: - description: 'Determine if the `client_javascript_recommend` job should run' + description: Determine if the `client_javascript_recommend` job should run 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 }} RUN_JS_CLIENT_PERSO: - description: 'Determine if the `client_javascript_perso` job should run' + description: Determine if the `client_javascript_perso` job should run 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 }} RUN_JS_CLIENT_ANALYTICS: - description: 'Determine if the `client_javascript_analytics` job should run' + description: Determine if the `client_javascript_analytics` job should run 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 }} # java client variables RUN_JAVA_CLIENT: - description: 'Determine if the `client_java_*` job should run' + description: Determine if the `client_java_*` job should run 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 }} # cts variables RUN_CTS: - description: 'Determine if the `cts` job should run' + description: Determine if the `cts` job should run 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 }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 83cecf9a00..c7ff569a5f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -22,6 +22,9 @@ jobs: - name: Setup id: setup uses: ./.github/actions/setup + + - name: Lint GitHub actions + run: yarn eslint --ext=yml .github/actions .github/workflows outputs: RUN_SPECS_SEARCH: ${{ steps.setup.outputs.RUN_SPECS_SEARCH }} RUN_SPECS_RECOMMEND: ${{ steps.setup.outputs.RUN_SPECS_RECOMMEND }} @@ -53,6 +56,9 @@ jobs: - name: Checking search specs run: yarn build:specs search + - name: Lint search specs + run: yarn eslint --ext=yml specs/search + specs_recommend: runs-on: ubuntu-20.04 needs: setup @@ -66,6 +72,9 @@ jobs: - name: Checking recommend specs run: yarn build:specs recommend + - name: Lint recommend specs + run: yarn eslint --ext=yml specs/recommend + specs_perso: runs-on: ubuntu-20.04 needs: setup @@ -79,6 +88,9 @@ jobs: - name: Checking personalization specs run: yarn build:specs personalization + - name: Lint personalization specs + run: yarn eslint --ext=yml specs/personalization + specs_analytics: runs-on: ubuntu-20.04 needs: setup @@ -92,6 +104,9 @@ jobs: - name: Checking analytics specs run: yarn build:specs analytics + - name: Lint analytics specs + run: yarn eslint --ext=yml specs/analytics + client_javascript_search: runs-on: ubuntu-20.04 needs: [specs_search] @@ -222,13 +237,12 @@ jobs: cts: runs-on: ubuntu-20.04 needs: - [ - client_javascript_search, - client_javascript_recommend, - client_javascript_perso, - client_javascript_analytics, - client_java_search, - ] + - client_javascript_search + - client_javascript_recommend + - client_javascript_perso + - client_javascript_analytics + - client_java_search + if: ${{ always() && needs.setup.outputs.RUN_CTS == 'true' }} steps: - uses: actions/checkout@v2