Skip to content

Commit 6df7d1a

Browse files
committed
Integrate MinIO Client with CI
Download MinIO Client when using GitHub Actions.
1 parent d171498 commit 6df7d1a

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,27 @@ jobs:
1919
- uses: actions/checkout@v2
2020

2121
- name: Install dependencies
22-
run: sudo apt-get install -y wait-for-it
22+
run: sudo apt-get update -qq && sudo apt-get install -y curl wait-for-it
23+
- name: Restore cached binaries
24+
id: cache-binaries-restore
25+
uses: actions/cache/restore@v3
26+
with:
27+
path: .bin
28+
key: ${{ runner.os }}-binaries
29+
- name: Install MinIO Client
30+
run: |
31+
mkdir .bin || exit 0
32+
cd .bin
33+
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"
34+
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 -
35+
mv mc.RELEASE.2023-06-19T19-31-19Z mc
36+
chmod +x mc
37+
- name: Save cached binaries
38+
id: cache-binaries-save
39+
uses: actions/cache/save@v3
40+
with:
41+
path: .bin
42+
key: ${{ steps.cache-binaries-restore.outputs.cache-primary-key }}
2343
- name: Run tests - latest njs version
2444
run: ./test.sh --latest-njs --type oss
2545
- name: Run tests - stable njs version

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ modules.xml
110110
test-settings.*
111111
s3-requests.http
112112
httpRequests/
113+
114+
.bin/

test.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,16 @@ if ! [ -x "${curl_cmd}" ]; then
143143
exit ${no_dep_exit_code}
144144
fi
145145

146-
mc_cmd="$(command -v mc)"
146+
if command -v mc > /dev/null; then
147+
mc_cmd="$(command -v mc)"
148+
elif [ -x "${script_dir}/.bin/mc" ]; then
149+
mc_cmd="${script_dir}/.bin/mc"
150+
else
151+
e "required dependency not found: mc not found in the path or not executable"
152+
exit ${no_dep_exit_code}
153+
fi
154+
e "Using MinIO Client: ${mc_cmd}"
155+
147156
if ! [ -x "${mc_cmd}" ]; then
148157
e "required dependency not found: mc not found in the path or not executable"
149158
exit ${no_dep_exit_code}

0 commit comments

Comments
 (0)