Skip to content

Commit

Permalink
feat(script): variadic parameters (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored May 5, 2022
1 parent 9f1730c commit 30111c9
Show file tree
Hide file tree
Showing 21 changed files with 351 additions and 661 deletions.
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:
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' }}
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

0 comments on commit 30111c9

Please sign in to comment.