Skip to content

chore(ci): fix built client cache #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ runs:
uses: actions/cache@v2
with:
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') }}
key: ${{ runner.os }}-js-client-search-${{ hashFiles('clients/algoliasearch-client-javascript/client-search/**') }}

- 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/dist
key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('clients/algoliasearch-client-javascript/recommend/**') }}

- 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/dist
key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('clients/algoliasearch-client-javascript/client-personalization/**') }}

- 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/dist
key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('clients/algoliasearch-client-javascript/client-analytics/**') }}

- 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/target
key: ${{ runner.os }}-java-client-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-java-client-${{ hashFiles('clients/algoliasearch-client-java-2/**') }}

# setup yarn
- name: Get yarn cache directory path
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ outputs:
# cts variables
RUN_CTS:
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.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.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 }}
75 changes: 45 additions & 30 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,21 @@ jobs:
- name: Restore cache
uses: ./.github/actions/cache

- name: Cache search client
id: cache
uses: actions/cache@v2
with:
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-search/dist
key: ${{ runner.os }}-js-client-search-${{ hashFiles('clients/algoliasearch-client-javascript/client-search/**') }}

- name: Generate search client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn generate javascript search

- name: Build search client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:clients javascript search

- 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/dist
key: ${{ runner.os }}-js-client-search-${{ hashFiles('yarn.lock') }}

client_javascript_recommend:
runs-on: ubuntu-20.04
needs: [specs_recommend]
Expand All @@ -124,18 +127,21 @@ jobs:
- name: Restore cache
uses: ./.github/actions/cache

- name: Cache recommend client
id: cache
uses: actions/cache@v2
with:
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/recommend/dist
key: ${{ runner.os }}-js-client-recommend-${{ hashFiles('clients/algoliasearch-client-javascript/recommend/**') }}

- name: Generate recommend client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn generate javascript recommend

- name: Build recommend client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:clients javascript recommend

- name: Cache recommend client
uses: actions/cache@v2
with:
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:
runs-on: ubuntu-20.04
needs: [specs_perso]
Expand All @@ -146,18 +152,21 @@ jobs:
- name: Restore cache
uses: ./.github/actions/cache

- name: Cache personalization client
id: cache
uses: actions/cache@v2
with:
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-personalization/dist
key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('clients/algoliasearch-client-javascript/client-personalization/**') }}

- name: Generate personalization client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn generate javascript personalization

- name: Build personalization client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:clients javascript personalization

- 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/dist
key: ${{ runner.os }}-js-client-personalization-${{ hashFiles('yarn.lock') }}

client_javascript_analytics:
runs-on: ubuntu-20.04
needs: [specs_analytics]
Expand All @@ -168,18 +177,21 @@ jobs:
- name: Restore cache
uses: ./.github/actions/cache

- name: Cache analytics client
id: cache
uses: actions/cache@v2
with:
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/client-analytics/dist
key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('clients/algoliasearch-client-javascript/client-analytics/**') }}

- name: Generate analytics client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn generate javascript analytics

- name: Build analytics client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:clients javascript analytics

- 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/dist
key: ${{ runner.os }}-js-client-analytics-${{ hashFiles('yarn.lock') }}

client_java_search:
runs-on: ubuntu-20.04
needs: [specs_search]
Expand All @@ -192,18 +204,21 @@ jobs:
with:
job: java

- name: Cache built clients
id: cache
uses: actions/cache@v2
with:
path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/target
key: ${{ runner.os }}-java-client-${{ hashFiles('clients/algoliasearch-client-java-2/**') }}

- name: Generate search client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn generate java search

- name: Build search client
if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:clients java search

- name: Cache built clients
uses: actions/cache@v2
with:
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:
runs-on: ubuntu-20.04
needs:
Expand Down