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
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,43 @@ jobs:
- run: ./setup-cli/assert/clean.sh
shell: bash

action_twice:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: ./setup-cli

# Confirm the action can be invoked more than once in the same job, and
# that each invocation resolves to its own binary.
- uses: ./setup-cli

- run: echo $(which databricks)
shell: bash

- uses: ./setup-cli

- run: echo $(which databricks)
shell: bash

- run: databricks version
shell: bash

- run: ./setup-cli/assert/version.sh $(cat ./setup-cli/VERSION)
shell: bash

- run: ./setup-cli/assert/clean.sh
shell: bash

install:
runs-on: ${{ matrix.os }}

Expand Down
11 changes: 7 additions & 4 deletions setup_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@ ARM64)
;;
esac

# Change into temporary directory.
cd "$RUNNER_TEMP"
# Use a unique directory per invocation so repeated calls in the same job (and
# other tools using $RUNNER_TEMP) don't collide. $RUNNER_TEMP is emptied at the
# beginning and end of each job, so it needs no manual cleanup; see
# https://docs.github.com/en/actions/reference/workflows-and-actions/variables
dir="$(mktemp -d "$RUNNER_TEMP/databricks.XXXXXX")"
cd "$dir"

# Download release archive.
curl -fsSL -O "https://github.com/databricks/cli/releases/download/v${VERSION}/${FILE}.zip"

# Unzip release archive.
unzip -q "${FILE}.zip" -d .bin
unzip -q "${FILE}.zip"

# Add databricks to path.
dir=$PWD/.bin
chmod +x "${dir}/databricks"
echo "$dir" >> "$GITHUB_PATH"
12 changes: 8 additions & 4 deletions setup_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ macOS)
;;
esac

# Change into temporary directory.
cd "$RUNNER_TEMP"
# Use a unique directory per invocation so repeated calls in the same job (and
# other tools using $RUNNER_TEMP) don't collide. $RUNNER_TEMP is emptied at the
# beginning and end of each job, so it needs no manual cleanup; see
# https://docs.github.com/en/actions/reference/workflows-and-actions/variables
tmpdir="$(mktemp -d "$RUNNER_TEMP/databricks.XXXXXX")"
cd "$tmpdir"

gh run download "$last_successful_run_id" -n "$artifact" -D .bin
gh run download "$last_successful_run_id" -n "$artifact" -D .

dir="$PWD/.bin/$(cli_snapshot_directory)"
dir="$PWD/$(cli_snapshot_directory)"

if [ ! -d "$dir" ]; then
echo "Directory does not exist: $dir"
Expand Down