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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(script): variadic parameters #472

Merged
merged 6 commits into from
May 5, 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
242 changes: 0 additions & 242 deletions .github/actions/restore-all/action.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/actions/restore-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Restore artifacts

description: |
When no input is given, artifacts are restored in the current directory, under their artifact `name`.

This composite restore all of our artifacts, at their right path.

inputs:
type:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we go full circle with the cache ahah

description: Type of artifacts to restore (`all` | `specs` | `utils`)
required: false

runs:
using: composite
steps:
# Bundled specs
- name: specs
if: ${{ inputs.type == 'all' || inputs.type == 'specs' }}
uses: actions/download-artifact@v3
with:
name: specs
path: specs/bundled/

# JavaScript utils
- name: client-javascript-utils-client-common
if: ${{ inputs.type == 'all' || inputs.type == '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.type == 'all' || inputs.type == '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.type == 'all' || inputs.type == 'utils' }}
uses: actions/download-artifact@v3
with:
name: client-javascript-utils-requester-node-http
path: clients/algoliasearch-client-javascript/packages/requester-node-http/

# JavaScript
- name: Download clients-javascript artifact
if: ${{ inputs.type == 'all' }}
uses: actions/download-artifact@v3
with:
name: clients-javascript

- name: Unzip clients-javascript artifact
if: ${{ inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-javascript.zip

# PHP
- name: Download clients-php artifact
if: ${{ inputs.type == 'all' }}
uses: actions/download-artifact@v3
with:
name: clients-php

- name: Unzip clients-php artifact
if: ${{ inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-php.zip

# Java
- name: Download clients-java artifact
if: ${{ inputs.type == 'all' }}
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/download-artifact@v3
with:
name: clients-java

- name: Unzip clients-java artifact
if: ${{ inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-java.zip
32 changes: 8 additions & 24 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,12 @@ outputs:
description: The generated `specs` matrix
value: ${{ steps.spec-matrix.outputs.MATRIX }}

RUN_JAVASCRIPT:
description: Determine if the `client_javascript` job should run
value: ${{ steps.gen-matrix.outputs.RUN_JAVASCRIPT }}
JAVASCRIPT_MATRIX:
description: The generated `client_javascript` matrix
value: ${{ steps.gen-matrix.outputs.JAVASCRIPT_MATRIX }}

RUN_JAVA:
description: Determine if the `client_java` job should run
value: ${{ steps.gen-matrix.outputs.RUN_JAVA }}
JAVA_MATRIX:
description: The generated `client_java` matrix
value: ${{ steps.gen-matrix.outputs.JAVA_MATRIX }}

RUN_PHP:
description: Determine if the `client_php` job should run
value: ${{ steps.gen-matrix.outputs.RUN_PHP }}
PHP_MATRIX:
description: The generated `client_php` matrix
value: ${{ steps.gen-matrix.outputs.PHP_MATRIX }}
RUN_GEN:
description: Determine if the `client_gen` job should run
value: ${{ steps.gen-matrix.outputs.RUN_GEN }}
GEN_MATRIX:
description: The generated `client_gen` matrix
value: ${{ steps.gen-matrix.outputs.GEN_MATRIX }}

RUN_JS_ALGOLIASEARCH:
description: Determine if the `client-javascript-algoliasearch` job should run
Expand All @@ -143,7 +129,7 @@ outputs:
value: ${{ steps.diff.outputs.JS_COMMON_TESTS_CHANGED > 0 }}

RUN_CTS:
description: Determine if the `cts` job should run
description: Determine if the `cts` jobs should run
value: ${{
steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 ||
steps.diff.outputs.SCRIPTS_CHANGED > 0 ||
Expand All @@ -158,6 +144,4 @@ outputs:
description: Determine if the `codegen` job should run
value: ${{
steps.spec-matrix.outputs.RUN_SPECS == 'true' ||
steps.gen-matrix.outputs.RUN_JAVASCRIPT == 'true' ||
steps.gen-matrix.outputs.RUN_JAVA == 'true' ||
steps.gen-matrix.outputs.RUN_PHP == 'true' }}
steps.gen-matrix.outputs.RUN_GEN == 'true' }}
Loading