-
Notifications
You must be signed in to change notification settings - Fork 21
chore(js): decouple workspaces APIC-550 #739
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
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
94d4b36
chore(js): decouple workspaces
millotp 56b2d02
unique id
millotp 6110821
missing &&
millotp 1036cff
fix gen and remove matrix
millotp 8eb649f
add back cts manager
millotp 52efe4f
review partie 1
millotp dca8711
review partie 2
millotp 58e1eee
space
millotp 1bdd060
quotes
millotp 330f0bd
run all cmd from the monorepo root
millotp 91bc394
fix cache key
millotp cff08d1
review
millotp 70162b6
env
millotp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,17 +96,15 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
timeout-minutes: 10 | ||
needs: setup | ||
strategy: | ||
matrix: ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX) }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache bundled specs | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ matrix.client.cacheKey }} | ||
path: ${{ matrix.client.bundledPath }} | ||
key: ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).cacheKey }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can set an env for the job level e.g. under
so we can use it everywhere in it :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no way ! |
||
path: ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).bundledPath }} | ||
|
||
- name: Setup | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
|
@@ -116,14 +114,14 @@ jobs: | |
|
||
- name: Building specs | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: yarn cli build specs ${{ matrix.client.toRun }} | ||
run: yarn cli build specs ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).toRun }} | ||
|
||
- name: Store bundled specs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
if-no-files-found: error | ||
name: specs | ||
path: ${{ matrix.client.bundledPath }} | ||
path: ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).bundledPath }} | ||
|
||
client_javascript_utils: | ||
timeout-minutes: 10 | ||
|
@@ -155,14 +153,15 @@ jobs: | |
uses: ./.github/actions/setup | ||
with: | ||
type: minimal | ||
language: javascript | ||
|
||
- name: Build '${{ matrix.client }}' client | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: yarn workspace algoliasearch-client-javascript build ${{ matrix.client }} | ||
run: cd clients/algoliasearch-client-javascript && yarn build ${{ matrix.client }} | ||
millotp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run tests for 'client-common' | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client == 'client-common' }} | ||
run: yarn workspace @experimental-api-clients-automation/client-common test | ||
run: cd clients/algoliasearch-client-javascript && yarn workspace @experimental-api-clients-automation/client-common test | ||
|
||
- name: Store '${{ matrix.client }}' JavaScript utils package | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -211,11 +210,17 @@ jobs: | |
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
with: | ||
language: ${{ matrix.client.language }} | ||
|
||
- name: Generate clients | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: yarn cli generate ${{ matrix.client.language }} ${{ matrix.client.toRun }} | ||
|
||
- name: Update `yarn.lock` for JavaScript | ||
if: ${{ matrix.client.language == 'javascript' }} | ||
run: cd ${{ matrix.client.path }} && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install | ||
|
||
- name: Build clients | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language != 'php' }} | ||
run: yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toBuild }} | ||
|
@@ -226,17 +231,35 @@ jobs: | |
|
||
- name: Run JavaScript 'algoliasearch' client tests | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' && matrix.client.language == 'javascript' }} | ||
run: yarn workspace @experimental-api-clients-automation/algoliasearch test | ||
run: cd ${{ matrix.client.path }} && yarn workspace @experimental-api-clients-automation/algoliasearch test | ||
|
||
- name: Clean CTS output before generate | ||
run: rm -rf ${{ matrix.client.testsToDelete }} || true | ||
|
||
- name: Generate CTS | ||
run: yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }} | ||
|
||
- name: Update `yarn.lock` for JavaScript release | ||
if: ${{ matrix.client.language == 'javascript' && (startsWith(github.head_ref, 'chore/prepare-release-') || github.ref == 'refs/heads/main') }} | ||
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install | ||
# JavaScript test deps (needs to be cached because they are huge and inefficient) | ||
- name: Get yarn js test cache directory path | ||
if: ${{ matrix.client.language == 'javascript' }} | ||
shell: bash | ||
id: yarn-cache-dir-tests | ||
run: echo "::set-output name=dir::$(cd ${{ matrix.client.testsRootFolder }} && yarn config get cacheFolder)" | ||
|
||
- name: Restore Yarn js tests | ||
if: ${{ matrix.client.language == 'javascript' }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-tests.outputs.dir || format('{0}/.yarn/cache', matrix.client.testsRootFolder) }} | ||
# let yarn handle the cache hash | ||
key: yarn-cache-tests-${{ env.CACHE_VERSION }} | ||
|
||
- name: Cache js tests node modules | ||
if: ${{ matrix.client.language == 'javascript' }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ matrix.client.testsRootFolder }}/node_modules | ||
key: node-modules-tests-${{ env.CACHE_VERSION }}-${{ hashFiles(format('{0}/.yarn.lock', matrix.client.testsRootFolder)) }} | ||
|
||
- name: Run CTS | ||
run: yarn cli cts run ${{ matrix.client.language }} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.