diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5c60e36..c28abe9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,20 +26,30 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - - # Use fake-s3 instead of MinIO - simpler and more reliable - s3: - image: adobe/s3mock:latest + # Garage S3 service - just like in docker-compose! + garage: + image: dxflrs/garage:v2.3.0 env: - initialBuckets: soaricarus-ci-bucket - defaultRegion: ${{ secrets.GARAGE_REGION }} + GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900" + GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900" + GARAGE_CLUSTER_REPLICATION_MODE: "none" + GARAGE_RPC_SECRET: "w03ABWJDfYsrkd+WpT/7G7gVkFCJQi+MGt/+1nyy0hc=" + GARAGE_ADMIN_TOKEN: "test-admin-token" + GARAGE_DEFAULT_ACCESS_KEY: "test" + GARAGE_DEFAULT_SECRET_KEY: "test" + GARAGE_DEFAULT_BUCKET: "soaricarus-ci-bucket" + GARAGE_S3_REGION: "us-east-1" + GARAGE_DATA_DIR: "/data" + GARAGE_METADATA_DIR: "/data/meta" ports: - - 9090:9090 + - 3900:3900 options: >- - --health-cmd "curl -f http://localhost:9090/ || exit 1" + --health-cmd "curl -f http://localhost:3900/ || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5 + command: ["/garage", "server", "--single-node", "--default-bucket"] + steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -60,19 +70,17 @@ jobs: - name: Setup S3 run: | - # No need to install mc or create bucket - S3Mock creates it automatically! - echo "S3_BUCKET_NAME=soaricarus-ci-bucket" >> $GITHUB_ENV - echo "S3_ENDPOINT_URL=http://localhost:9090" >> $GITHUB_ENV - echo "AWS_ACCESS_KEY_ID=test" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=test" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV - - # Test connection to S3Mock - curl -v http://localhost:9090 || echo "S3Mock not responding" - env: - AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SECRET }} - AWS_DEFAULT_REGION: ${{ secrets.GARAGE_REGION }} + sudo apt update + sudo apt install curl unzip -y + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + unzip awscliv2.zip + sudo ./aws/install + aws --version + # Garage is accessible at localhost:3900 + curl -v http://localhost:3900 + + # Create bucket + aws --endpoint-url=http://localhost:3900 s3 mb s3://soaricarus-ci-bucket --region us-east-1 - name: Run tests env: