mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-08 15:41:15 +02:00
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6 to 7. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
144 lines
4.5 KiB
YAML
144 lines
4.5 KiB
YAML
name: "S3 Proxy Signature Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'weed/s3api/**'
|
|
- 'weed/server/**'
|
|
- 'test/s3/proxy_signature/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.github/workflows/s3-proxy-signature-tests.yml'
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'weed/s3api/**'
|
|
- 'weed/server/**'
|
|
- 'test/s3/proxy_signature/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.github/workflows/s3-proxy-signature-tests.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref || github.ref }}/s3-proxy-signature-tests
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
proxy-signature-tests:
|
|
name: S3 Proxy Signature Verification Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
id: go
|
|
|
|
- name: Configure Docker Hub mirror
|
|
run: |
|
|
echo '{"registry-mirrors": ["https://mirror.gcr.io"]}' | sudo tee /etc/docker/daemon.json
|
|
sudo systemctl restart docker
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Build SeaweedFS binary for Linux
|
|
run: |
|
|
set -x
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -v -o test/s3/proxy_signature/weed ./weed
|
|
|
|
- name: Run S3 Proxy Signature Tests
|
|
timeout-minutes: 10
|
|
working-directory: test/s3/proxy_signature
|
|
run: |
|
|
set -x
|
|
echo "Starting Docker Compose services..."
|
|
docker compose up -d --build
|
|
|
|
# Check if containers are running
|
|
echo "Checking container status..."
|
|
docker compose ps
|
|
|
|
# Wait for services to be ready
|
|
echo "Waiting for nginx proxy to be ready..."
|
|
PROXY_READY=0
|
|
for i in $(seq 1 30); do
|
|
if curl -s http://localhost:9000/ > /dev/null 2>&1; then
|
|
echo "Proxy is ready"
|
|
PROXY_READY=1
|
|
break
|
|
fi
|
|
echo "Waiting for proxy... ($i/30)"
|
|
sleep 1
|
|
done
|
|
if [ $PROXY_READY -eq 0 ]; then
|
|
echo "ERROR: Proxy failed to become ready after 30 seconds"
|
|
echo "Docker compose logs:"
|
|
docker compose logs --no-color || true
|
|
exit 1
|
|
fi
|
|
|
|
# Wait for SeaweedFS to be ready
|
|
echo "Waiting for SeaweedFS S3 gateway to be ready via proxy..."
|
|
S3_READY=0
|
|
for i in $(seq 1 30); do
|
|
# Check logs first for the readiness line. weed mini's progress
|
|
# board prints " S3 ready (Xs)"; older builds and the
|
|
# standalone S3 binary log "S3 (gateway|service) ... ready".
|
|
if docker compose logs seaweedfs 2>&1 | grep -qE "S3 (gateway|service).*(started|ready)|S3[[:space:]]+ready"; then
|
|
echo "SeaweedFS S3 gateway is ready"
|
|
S3_READY=1
|
|
break
|
|
fi
|
|
# Fallback: check headers via proxy (which is already ready)
|
|
if curl -s -I http://localhost:9000/ | grep -qi "SeaweedFS"; then
|
|
echo "SeaweedFS S3 gateway is responding via proxy"
|
|
S3_READY=1
|
|
break
|
|
fi
|
|
echo "Waiting for S3 gateway... ($i/30)"
|
|
sleep 1
|
|
done
|
|
if [ $S3_READY -eq 0 ]; then
|
|
echo "ERROR: SeaweedFS S3 gateway failed to become ready after 30 seconds"
|
|
echo "Latest seaweedfs logs:"
|
|
docker compose logs --no-color --tail 20 seaweedfs || true
|
|
exit 1
|
|
fi
|
|
|
|
# Run the test script inside AWS CLI container
|
|
echo "Running test script..."
|
|
docker run --rm --network host \
|
|
--entrypoint bash \
|
|
amazon/aws-cli:latest \
|
|
-c "$(cat test.sh)"
|
|
|
|
TEST_RESULT=$?
|
|
|
|
# Cleanup
|
|
docker compose down
|
|
|
|
exit $TEST_RESULT
|
|
|
|
- name: Cleanup on failure
|
|
if: failure()
|
|
working-directory: test/s3/proxy_signature
|
|
run: |
|
|
echo "Cleaning up Docker containers..."
|
|
ls -al weed || true
|
|
ldd weed || true
|
|
echo "Docker compose logs:"
|
|
docker compose logs --no-color || true
|
|
echo "Container status before cleanup:"
|
|
docker ps -a
|
|
echo "Stopping services..."
|
|
docker compose down || true
|