Skip to content

Commit 1d81e54

Browse files
Merge pull request #118 from ThomasWaldmann/ci-s3-testing
CI: add s3 store testing
2 parents 638e133 + 2676bc2 commit 1d81e54

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Install Linux packages
6767
run: |
6868
sudo apt-get update
69-
sudo apt-get install -y rclone openssh-server
69+
sudo apt-get install -y rclone openssh-server curl
7070
- name: Configure OpenSSH SFTP server (test only)
7171
run: |
7272
sudo mkdir -p /run/sshd
@@ -95,6 +95,31 @@ jobs:
9595
ssh-add ~/.ssh/id_ed25519
9696
# Export SFTP test URL for tox via GITHUB_ENV
9797
echo "BORGSTORE_TEST_SFTP_URL=sftp://sftpuser@localhost:22/borgstore/temp-store" >> $GITHUB_ENV
98+
- name: Install and configure MinIO S3 server (test only)
99+
run: |
100+
set -e
101+
arch=$(uname -m)
102+
case "$arch" in
103+
x86_64|amd64) srv_url=https://dl.min.io/server/minio/release/linux-amd64/minio; cli_url=https://dl.min.io/client/mc/release/linux-amd64/mc ;;
104+
aarch64|arm64) srv_url=https://dl.min.io/server/minio/release/linux-arm64/minio; cli_url=https://dl.min.io/client/mc/release/linux-arm64/mc ;;
105+
*) echo "Unsupported arch: $arch"; exit 1 ;;
106+
esac
107+
curl -fsSL -o /usr/local/bin/minio "$srv_url"
108+
curl -fsSL -o /usr/local/bin/mc "$cli_url"
109+
sudo chmod +x /usr/local/bin/minio /usr/local/bin/mc
110+
export PATH=/usr/local/bin:$PATH
111+
# Start MinIO on :9000 with default credentials (minioadmin/minioadmin)
112+
MINIO_DIR="$GITHUB_WORKSPACE/.minio-data"
113+
MINIO_LOG="$GITHUB_WORKSPACE/.minio.log"
114+
mkdir -p "$MINIO_DIR"
115+
nohup minio server "$MINIO_DIR" --address ":9000" >"$MINIO_LOG" 2>&1 &
116+
# Wait for MinIO port to be ready
117+
for i in $(seq 1 60); do (echo > /dev/tcp/127.0.0.1/9000) >/dev/null 2>&1 && break; sleep 1; done
118+
# Configure client and create bucket
119+
mc alias set local http://127.0.0.1:9000 minioadmin minioadmin
120+
mc mb --ignore-existing local/test
121+
# Export S3 test URL for tox via GITHUB_ENV
122+
echo "BORGSTORE_TEST_S3_URL=s3:minioadmin:minioadmin@http://127.0.0.1:9000/test/path" >> $GITHUB_ENV
98123
- name: Set up Python ${{ matrix.python-version }}
99124
uses: actions/setup-python@v5
100125
with:
@@ -103,7 +128,8 @@ jobs:
103128
run: |
104129
python -m pip install --upgrade pip setuptools
105130
pip install -r requirements.d/dev.txt
106-
- name: Install borgstore (with sftp extra)
107-
run: pip install -ve ".[sftp]"
108-
- name: run tox env
109-
run: tox -e sftp
131+
- name: Install borgstore (with all extras)
132+
run: pip install -ve ".[s3,sftp]"
133+
- name: run tox envs
134+
run: |
135+
tox -e all_extras

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@ deps =
4040
commands = pytest -v -rs tests
4141
pass_env =
4242
BORGSTORE_TEST_SFTP_URL
43+
44+
[testenv:all_extras]
45+
deps =
46+
pytest
47+
boto3
48+
paramiko
49+
commands = pytest -v -rs tests
50+
pass_env =
51+
BORGSTORE_TEST_*_URL

0 commit comments

Comments
 (0)