Skip to content

Commit

Permalink
Integrate MinIO Client with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dekobon committed Jun 22, 2023
1 parent 2891285 commit ab092c4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit ab092c4

Please sign in to comment.