Skip to content
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
35 changes: 33 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- uses: ./
- run: autify --version
- run: echo token | autify web auth login
- run: autify connect client install

test-specific:
strategy:
Expand All @@ -45,4 +44,36 @@ jobs:
shell-installer-url: "https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/beta/install-cicd.bash"
- run: autify --version | grep beta
- run: echo token | autify web auth login
- run: autify connect client install

test-integration-test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ./
with:
install-cli-integration-test: 'true'
- run: |
echo token | autify web auth login
echo token | autify mobile auth login
autify connect client install
env:
AUTIFY_CONNECT_CLIENT_MODE: fake
- run: autify-cli-integration-test

test-use-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
use-cache: 'true'
- uses: ./
with:
use-cache: 'true'
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,31 @@ The installed directory will be added to `PATH` environment variable of your wor

```yaml
- uses: autifyhq/actions-setup-cli@v2
# Optionally specify the installer script which installs `autify` at `./autify/bin`.
# If omitted, the default installer will be used. (Currently beta channel)
shell-installer-url: "https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/beta/install-cicd.bash"

# Then, `autify` is available
- run: autify --version
```

### Options

Most of the case, no options are needed. When you need more customization, here is the list:

```yaml
shell-installer-url:
required: false
description: "Shell installer URL"
# TODO: Use stable
default: "https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/beta/install-cicd.bash"
use-cache:
required: false
description: "Use cached CLI installed by previous steps if existing."
default: "false"
install-cli-integration-test:
required: false
description: "Install autify-cli-integration-test package as well."
default: "false"
```

### v1

**NOTE: v1 is no longer maintained. Please migrate to v2.**
Expand Down
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@ inputs:
description: 'Shell installer URL'
# TODO: Use stable
default: "https://autify-cli-assets.s3.amazonaws.com/autify-cli/channels/beta/install-cicd.bash"
use-cache:
required: false
description: 'Use cached CLI installed by previous steps if existing.'
default: 'false'
install-cli-integration-test:
required: false
description: 'Install autify-cli-integration-test package as well.'
default: 'false'

runs:
using: 'composite'
steps:
- if: ${{ inputs.install-cli-integration-test == 'true' }}
uses: actions/setup-node@v3
- run: $GITHUB_ACTION_PATH/script.bash
shell: bash
env:
INPUT_SHELL_INSTALLER_URL: ${{ inputs.shell-installer-url }}
INPUT_USE_CACHE: ${{ inputs.use-cache }}
INPUT_INSTALL_CLI_INTEGRATION_TEST: ${{ inputs.install-cli-integration-test }}
- run: autify --version
shell: bash
20 changes: 10 additions & 10 deletions script.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
set -xe

: "${INPUT_SHELL_INSTALLER_URL:?"Provide the installer URL"}"
: "${INPUT_USE_CACHE:?"Provide true or false"}"
: "${INPUT_INSTALL_CLI_INTEGRATION_TEST:?"Provide true or false"}"

TEMP_DIR=$(mktemp -d)
if [ "$INPUT_USE_CACHE" == "true" ]; then
export AUTIFY_CLI_INSTALL_USE_CACHE=1
fi
if [ "$INPUT_INSTALL_CLI_INTEGRATION_TEST" == "true" ]; then
export AUTIFY_CLI_INTEGRATION_TEST_INSTALL=1
fi

cd "$TEMP_DIR"
cd "$RUNNER_TEMP"
curl -L "$INPUT_SHELL_INSTALLER_URL" | bash -xe

BIN_DIR="$TEMP_DIR/autify/bin"
"$BIN_DIR"/autify --version

if [ "$(command -v cygpath)" ]; then
cygpath -w "$BIN_DIR" >> "$GITHUB_PATH"
else
echo "$BIN_DIR" >> "$GITHUB_PATH"
fi
cat "$RUNNER_TEMP/autify/path" >> "$GITHUB_PATH"