From ab092c49e88ea661d71a0d7fc9600df396c58cd9 Mon Sep 17 00:00:00 2001 From: Elijah Zupancic Date: Wed, 21 Jun 2023 15:00:24 -0700 Subject: [PATCH] Integrate MinIO Client with CI --- .github/workflows/main.yml | 22 +++++++++++++++++++++- test.sh | 11 ++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfd96396..93393fc8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,27 @@ jobs: - uses: actions/checkout@v2 - name: Install dependencies - run: sudo apt-get install -y wait-for-it + run: sudo apt-get update -qq && sudo apt-get install -y curl wait-for-it curl + - name: Restore cached binaries + id: cache-binaries-restore + uses: actions/cache/restore@v3 + with: + path: .bin + key: ${{ runner.os }}-binaries + - name: Install MinIO Client + run: | + mkdir .bin || exit 0 + cd .bin + curl --retry 6 --fail --silent --location --output mc.RELEASE.2023-06-19T19-31-19Z "https://dl.min.io/client/mc/release/linux-$(dpkg --print-architecture)/mc.RELEASE.2023-06-19T19-31-19Z" + curl --retry 6 --fail --silent --location "https://dl.min.io/client/mc/release/linux-$(dpkg --print-architecture)/mc.RELEASE.2023-06-19T19-31-19Z.sha256sum" | sha256sum --check - + mv mc.RELEASE.2023-06-19T19-31-19Z mc + chmod +x mc + - name: Save cached binaries + id: cache-binaries-save + uses: actions/cache/save@v3 + with: + path: .bin + key: ${{ steps.cache-binaries-restore.outputs.cache-primary-key }} - name: Run tests - latest njs version run: ./test.sh --latest-njs --type oss - name: Run tests - stable njs version diff --git a/test.sh b/test.sh index 0b9dc5fc..507fa0f8 100755 --- a/test.sh +++ b/test.sh @@ -143,7 +143,16 @@ if ! [ -x "${curl_cmd}" ]; then exit ${no_dep_exit_code} fi -mc_cmd="$(command -v mc)" +if command -v mc > /dev/null; then + mc_cmd="$(command -v mc)" +elif [ -x "${script_dir}/.bin/mc" ]; then + mc_cmd="${script_dir}/.bin/mc" +else + e "required dependency not found: mc not found in the path or not executable" + exit ${no_dep_exit_code} +fi +e "Using MinIO Client: ${mc_cmd}" + if ! [ -x "${mc_cmd}" ]; then e "required dependency not found: mc not found in the path or not executable" exit ${no_dep_exit_code}