Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(javascript): build #867

Merged
merged 9 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
31 changes: 1 addition & 30 deletions .github/actions/restore-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: |

inputs:
type:
description: Type of artifacts to restore (`all` | `specs` | `js_utils`)
description: Type of artifacts to restore (`all` | `specs`)
required: false
php:
description: Whether this job ran or not
Expand All @@ -30,35 +30,6 @@ runs:
name: specs
path: specs/bundled/

# JavaScript utils
- name: client-javascript-utils-client-common
if: ${{ (inputs.javascript == 'true' && inputs.type == 'all') || inputs.type == 'js_utils' }}
uses: actions/download-artifact@v3
with:
name: client-javascript-utils-client-common
path: clients/algoliasearch-client-javascript/packages/client-common/

- name: client-javascript-utils-requester-browser-xhr
if: ${{ (inputs.javascript == 'true' && inputs.type == 'all') || inputs.type == 'js_utils' }}
uses: actions/download-artifact@v3
with:
name: client-javascript-utils-requester-browser-xhr
path: clients/algoliasearch-client-javascript/packages/requester-browser-xhr/

- name: client-javascript-utils-requester-node-http
if: ${{ (inputs.javascript == 'true' && inputs.type == 'all') || inputs.type == 'js_utils' }}
uses: actions/download-artifact@v3
with:
name: client-javascript-utils-requester-node-http
path: clients/algoliasearch-client-javascript/packages/requester-node-http/

- name: client-javascript-utils-requester-fetch
if: ${{ (inputs.javascript == 'true' && inputs.type == 'all') || inputs.type == 'js_utils' }}
uses: actions/download-artifact@v3
with:
name: client-javascript-utils-requester-fetch
path: clients/algoliasearch-client-javascript/packages/requester-fetch/

# JavaScript
- name: Download clients-javascript artifact
if: ${{ inputs.javascript == 'true' && inputs.type == 'all' }}
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ runs:
if: ${{ inputs.language == 'javascript' }}
uses: actions/cache@v3
with:
path: clients/algoliasearch-client-javascript/node_modules
path: |
clients/algoliasearch-client-javascript/node_modules/.cache/
clients/algoliasearch-client-javascript/node_modules/
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
key: node-modules-client-${{ env.CACHE_VERSION }}-${{ hashFiles('clients/algoliasearch-client-javascript/yarn.lock') }}

- name: Install JavaScript client dependencies
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,12 @@ jobs:

- name: Build '${{ matrix.client }}' client
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: cd clients/algoliasearch-client-javascript && yarn build ${{ matrix.client }}
run: cd clients/algoliasearch-client-javascript && yarn build:many @algolia/${{ matrix.client }}

- name: Run tests for '${{ matrix.client }}'
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: cd clients/algoliasearch-client-javascript && yarn workspace @algolia/${{ matrix.client }} test

- name: Store '${{ matrix.client }}' JavaScript utils package
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: client-javascript-utils-${{ matrix.client }}
path: clients/algoliasearch-client-javascript/packages/${{ matrix.client }}

client_gen:
timeout-minutes: 15
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -206,13 +199,6 @@ jobs:
with:
type: specs

# Always download the utils for js, in case they changed we want to include them in the zip
- name: Download JavaScript utils artifacts
if: ${{ matrix.client.language == 'javascript' }}
uses: ./.github/actions/restore-artifacts
with:
type: js_utils

- name: Remove generated clients
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language == 'javascript' && startsWith(env.head_ref, 'chore/prepare-release-') }}
run: |
Expand All @@ -236,7 +222,7 @@ jobs:

- name: Build clients
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language != 'php' }}
run: yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toRun }}
run: ${{ matrix.client.buildCommand }}

- name: Test JavaScript bundle size
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language == 'javascript' && startsWith(env.head_ref, 'chore/prepare-release-') }}
Expand Down
2 changes: 2 additions & 0 deletions clients/algoliasearch-client-javascript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ yarn-error.log
!.yarn/plugins

node_modules

node_
Loading