From 95813dc265607c30dc92dc6d68b8a1a83e8a927a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 5 Jan 2022 17:23:17 +0100 Subject: [PATCH 1/5] chore(ci): fix --- .github/actions/cache/action.yml | 1 - .github/workflows/check.yml | 2 ++ tests/package.json | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index d4a0edf6a70..7bee50bf8e2 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -6,7 +6,6 @@ inputs: job: description: 'The job that requires this composite' required: true - default: 'cts' runs: using: composite diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index cad1dd69ba0..26a7ab9263a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -221,6 +221,8 @@ jobs: - name: Restore cache id: restore uses: ./.github/actions/cache + with: + job: cts - name: Generate CTS run: yarn cts:generate diff --git a/tests/package.json b/tests/package.json index d0863c38288..9615d4dad11 100644 --- a/tests/package.json +++ b/tests/package.json @@ -7,9 +7,11 @@ "test": "jest", "start": "yarn build && node dist/tests/generateCTS.js ${0:-all} && yarn lint:fix" }, - "devDependencies": { + "dependencies": { "@algolia/client-search": "5.0.0", - "@algolia/recommend": "5.0.0", + "@algolia/recommend": "5.0.0" + }, + "devDependencies": { "@apidevtools/swagger-parser": "10.0.3", "@types/jest": "27.0.3", "@types/mustache": "4.1.2", From b2e5add2fc1427b6680be1b7382b7dec4b7157be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 5 Jan 2022 17:35:26 +0100 Subject: [PATCH 2/5] remove globs from path --- .github/actions/cache/action.yml | 10 +++++----- .github/workflows/check.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 7bee50bf8e2..341ee0a3051 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -15,35 +15,35 @@ runs: if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search key: ${{ runner.os }}-js-client-search-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript recommend client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript personalization client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript analytics client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }} - name: Restore built Java client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2 key: ${{ runner.os }}-java-client-${{ hashFiles('**/pom.xml') }} # setup yarn diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 26a7ab9263a..fd7c1862a5b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -111,7 +111,7 @@ jobs: - name: Cache search client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search key: ${{ runner.os }}-js-client-search-${{ hashFiles('yarn.lock') }} client_javascript_recommend: @@ -133,7 +133,7 @@ jobs: - name: Cache recommend client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('yarn.lock') }} client_javascript_perso: @@ -155,7 +155,7 @@ jobs: - name: Cache personalization client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }} client_javascript_analytics: @@ -177,7 +177,7 @@ jobs: - name: Cache analytics client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics//** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }} client_java_search: @@ -201,7 +201,7 @@ jobs: - name: Cache built clients uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/** + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2 key: ${{ runner.os }}-java-client-${{ hashFiles('**/pom.xml') }} cts: From a04630ddd1faa81ea1fa0edab1b8984953503816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 5 Jan 2022 17:39:39 +0100 Subject: [PATCH 3/5] skip install on cache hit --- .github/actions/cache/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 341ee0a3051..4b1f6ed18e9 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -53,12 +53,14 @@ runs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore Yarn + id: yarn-cache uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir.outputs.dir || '/home/runner/work/api-clients-automation/api-clients-automation/.yarn/cache' }} key: node-cache-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - name: Install JavaScript dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' shell: bash run: yarn install From 3c8d57376afa1e2370afca2c453be55600513ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 5 Jan 2022 17:47:39 +0100 Subject: [PATCH 4/5] run all jobs on main --- .github/actions/cache/action.yml | 2 -- .github/actions/setup/action.yml | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 4b1f6ed18e9..341ee0a3051 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -53,14 +53,12 @@ runs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore Yarn - id: yarn-cache uses: actions/cache@v2 with: path: ${{ steps.yarn-cache-dir.outputs.dir || '/home/runner/work/api-clients-automation/api-clients-automation/.yarn/cache' }} key: node-cache-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - name: Install JavaScript dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' shell: bash run: yarn install diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 0e7c6eff728..60b952e17d2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -55,46 +55,46 @@ outputs: # specs variables RUN_SPECS_SEARCH: description: 'Determine if the `specs_search` job should run' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ 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 }} + value: ${{ github.ref_name == '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' - value: ${{ steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SPECS_CHANGED > 0 || steps.diff.outputs.CTS_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 }} + value: ${{ github.ref_name == 'main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SPECS_CHANGED > 0 || steps.diff.outputs.CTS_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 }} From 7fb735e77f5f3046a94929c0291a86800dac16c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 5 Jan 2022 17:59:02 +0100 Subject: [PATCH 5/5] cache dist path --- .github/actions/cache/action.yml | 10 +++++----- .github/actions/setup/action.yml | 24 ++++++++++++------------ .github/workflows/check.yml | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index 341ee0a3051..23227a84002 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -15,35 +15,35 @@ runs: if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search/dist key: ${{ runner.os }}-js-client-search-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript recommend client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend/dist key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript personalization client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization/dist key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }} - name: Restore built JavaScript analytics client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics/dist key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }} - name: Restore built Java client if: ${{ inputs.job == 'cts' }} uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2 + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/target key: ${{ runner.os }}-java-client-${{ hashFiles('**/pom.xml') }} # setup yarn diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 60b952e17d2..e5686cc8171 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -55,44 +55,44 @@ outputs: # specs variables RUN_SPECS_SEARCH: description: 'Determine if the `specs_search` job should run' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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' - value: ${{ github.ref_name == '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 }} + 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: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fd7c1862a5b..a2ee8194f29 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -111,7 +111,7 @@ jobs: - name: Cache search client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search/dist key: ${{ runner.os }}-js-client-search-${{ hashFiles('yarn.lock') }} client_javascript_recommend: @@ -133,7 +133,7 @@ jobs: - name: Cache recommend client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend/dist key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('yarn.lock') }} client_javascript_perso: @@ -155,7 +155,7 @@ jobs: - name: Cache personalization client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization/dist key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }} client_javascript_analytics: @@ -177,7 +177,7 @@ jobs: - name: Cache analytics client uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics/dist key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }} client_java_search: @@ -201,7 +201,7 @@ jobs: - name: Cache built clients uses: actions/cache@v2 with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2 + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/target key: ${{ runner.os }}-java-client-${{ hashFiles('**/pom.xml') }} cts: