|
| 1 | +name: MinIO Rust Library CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "master" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "master" ] |
| 8 | + |
| 9 | +env: |
| 10 | + RUST_LOG: debug |
| 11 | + CARGO_TERM_COLOR: always |
| 12 | + |
| 13 | +jobs: |
| 14 | + # Run once - same code for both variants |
| 15 | + check-format: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Check format |
| 20 | + run: | |
| 21 | + cargo fmt --all -- --check |
| 22 | +
|
| 23 | + # Run once - same code for both variants |
| 24 | + clippy: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: clippy |
| 29 | + run: cargo clippy --all-targets --all-features --workspace -- -D warnings |
| 30 | + |
| 31 | + # Run once - same code for both variants |
| 32 | + build: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + timeout-minutes: 5 |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - name: Build |
| 38 | + run: | |
| 39 | + cargo --version |
| 40 | + cargo build --bins --examples --tests --benches --verbose |
| 41 | +
|
| 42 | + # Test against AIStor MinIO |
| 43 | + test-aistor-multi-thread: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + needs: [check-format, clippy, build] |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - name: Start AIStor MinIO server |
| 49 | + run: | |
| 50 | + wget --quiet https://dl.minio.io/aistor/minio/release/linux-amd64/minio |
| 51 | + chmod +x minio |
| 52 | + echo "AIStor MinIO Server Version:" |
| 53 | + ./minio --version |
| 54 | + mkdir -p /tmp/certs |
| 55 | + cp ./tests/public.crt ./tests/private.key /tmp/certs/ |
| 56 | + MINIO_CI_CD=true \ |
| 57 | + MINIO_LICENSE=${{ secrets.AISTOR_LICENSE }} \ |
| 58 | + MINIO_NOTIFY_WEBHOOK_ENABLE_miniojavatest=on \ |
| 59 | + MINIO_NOTIFY_WEBHOOK_ENDPOINT_miniojavatest=http://example.org/ \ |
| 60 | + ./minio server /tmp/test-xl/{1...4}/ --certs-dir /tmp/certs/ & |
| 61 | + sleep 10 |
| 62 | + - name: Run tests (multi-thread) |
| 63 | + run: | |
| 64 | + export SERVER_ENDPOINT=localhost:9000 |
| 65 | + export ACCESS_KEY=${{ secrets.AISTOR_USER }} |
| 66 | + export SECRET_KEY=${{ secrets.AISTOR_LICENSE }} |
| 67 | + export ENABLE_HTTPS=1 |
| 68 | + export MINIO_SSL_CERT_FILE=./tests/public.crt |
| 69 | + MINIO_TEST_TOKIO_RUNTIME_FLAVOR="multi_thread" cargo test -- --nocapture |
| 70 | +
|
| 71 | + test-aistor-current-thread: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + needs: [check-format, clippy, build] |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + - name: Start AIStor MinIO server |
| 77 | + run: | |
| 78 | + wget --quiet https://dl.minio.io/aistor/minio/release/linux-amd64/minio |
| 79 | + chmod +x minio |
| 80 | + echo "AIStor MinIO Server Version:" |
| 81 | + ./minio --version |
| 82 | + mkdir -p /tmp/certs |
| 83 | + cp ./tests/public.crt ./tests/private.key /tmp/certs/ |
| 84 | + MINIO_CI_CD=true \ |
| 85 | + MINIO_LICENSE=${{ secrets.AISTOR_LICENSE }} \ |
| 86 | + MINIO_NOTIFY_WEBHOOK_ENABLE_miniojavatest=on \ |
| 87 | + MINIO_NOTIFY_WEBHOOK_ENDPOINT_miniojavatest=http://example.org/ \ |
| 88 | + ./minio server /tmp/test-xl/{1...4}/ --certs-dir /tmp/certs/ & |
| 89 | + sleep 10 |
| 90 | + - name: Run tests (current-thread) |
| 91 | + run: | |
| 92 | + export SERVER_ENDPOINT=localhost:9000 |
| 93 | + export ACCESS_KEY=${{ secrets.AISTOR_USER }} |
| 94 | + export SECRET_KEY=${{ secrets.AISTOR_LICENSE }} |
| 95 | + export ENABLE_HTTPS=1 |
| 96 | + export MINIO_SSL_CERT_FILE=./tests/public.crt |
| 97 | + MINIO_TEST_TOKIO_RUNTIME_FLAVOR="current_thread" cargo test -- --nocapture |
| 98 | +
|
| 99 | + # Test against OSS MinIO |
| 100 | + test-oss-multi-thread: |
| 101 | + runs-on: ubuntu-latest |
| 102 | + needs: [check-format, clippy, build] |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@v4 |
| 105 | + - name: Start OSS MinIO server |
| 106 | + run: | |
| 107 | + wget --quiet https://dl.min.io/server/minio/release/linux-amd64/minio |
| 108 | + chmod +x minio |
| 109 | + echo "OSS MinIO Server Version:" |
| 110 | + ./minio --version |
| 111 | + mkdir -p /tmp/certs |
| 112 | + cp ./tests/public.crt ./tests/private.key /tmp/certs/ |
| 113 | + MINIO_CI_CD=true \ |
| 114 | + MINIO_NOTIFY_WEBHOOK_ENABLE_miniojavatest=on \ |
| 115 | + MINIO_NOTIFY_WEBHOOK_ENDPOINT_miniojavatest=http://example.org/ \ |
| 116 | + ./minio server /tmp/test-xl/{1...4}/ --certs-dir /tmp/certs/ & |
| 117 | + sleep 10 |
| 118 | + - name: Run tests (multi-thread) |
| 119 | + run: | |
| 120 | + export SERVER_ENDPOINT=localhost:9000 |
| 121 | + export ACCESS_KEY=minioadmin |
| 122 | + export SECRET_KEY=minioadmin |
| 123 | + export ENABLE_HTTPS=1 |
| 124 | + export MINIO_SSL_CERT_FILE=./tests/public.crt |
| 125 | + MINIO_TEST_TOKIO_RUNTIME_FLAVOR="multi_thread" cargo test -- --nocapture |
| 126 | +
|
| 127 | + test-oss-current-thread: |
| 128 | + runs-on: ubuntu-latest |
| 129 | + needs: [check-format, clippy, build] |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v4 |
| 132 | + - name: Start OSS MinIO server |
| 133 | + run: | |
| 134 | + wget --quiet https://dl.min.io/server/minio/release/linux-amd64/minio |
| 135 | + chmod +x minio |
| 136 | + echo "OSS MinIO Server Version:" |
| 137 | + ./minio --version |
| 138 | + mkdir -p /tmp/certs |
| 139 | + cp ./tests/public.crt ./tests/private.key /tmp/certs/ |
| 140 | + MINIO_CI_CD=true \ |
| 141 | + MINIO_NOTIFY_WEBHOOK_ENABLE_miniojavatest=on \ |
| 142 | + MINIO_NOTIFY_WEBHOOK_ENDPOINT_miniojavatest=http://example.org/ \ |
| 143 | + ./minio server /tmp/test-xl/{1...4}/ --certs-dir /tmp/certs/ & |
| 144 | + sleep 10 |
| 145 | + - name: Run tests (current-thread) |
| 146 | + run: | |
| 147 | + export SERVER_ENDPOINT=localhost:9000 |
| 148 | + export ACCESS_KEY=minioadmin |
| 149 | + export SECRET_KEY=minioadmin |
| 150 | + export ENABLE_HTTPS=1 |
| 151 | + export MINIO_SSL_CERT_FILE=./tests/public.crt |
| 152 | + MINIO_TEST_TOKIO_RUNTIME_FLAVOR="current_thread" cargo test -- --nocapture |
0 commit comments