|
| 1 | +name: Compatibility Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - 'src/**' |
| 7 | + - 'pom.xml' |
| 8 | + - '.mvn/**' |
| 9 | + - 'mvnw' |
| 10 | + - 'mvnw.cmd' |
| 11 | + - 'Dockerfile' |
| 12 | + - 'Dockerfile.jvm-package' |
| 13 | + - 'Dockerfile.native' |
| 14 | + - 'Dockerfile.native-package' |
| 15 | + - 'docker-compose.yml' |
| 16 | + - 'docker-compose-test.yml' |
| 17 | + - '.github/workflows/compatibility.yml' |
| 18 | + |
| 19 | +permissions: |
| 20 | + contents: read |
| 21 | + |
| 22 | +jobs: |
| 23 | + build: |
| 24 | + name: Build floci image |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - uses: actions/setup-java@v4 |
| 30 | + with: |
| 31 | + java-version: '25' |
| 32 | + distribution: 'temurin' |
| 33 | + cache: maven |
| 34 | + |
| 35 | + - name: Build JVM artifact |
| 36 | + run: mvn clean package -DskipTests -q |
| 37 | + |
| 38 | + - uses: docker/setup-buildx-action@v3 |
| 39 | + |
| 40 | + - name: Build Docker image |
| 41 | + uses: docker/build-push-action@v6 |
| 42 | + with: |
| 43 | + context: . |
| 44 | + file: Dockerfile.jvm-package |
| 45 | + tags: floci:test |
| 46 | + outputs: type=docker,dest=/tmp/floci-image.tar |
| 47 | + cache-from: type=gha,scope=floci |
| 48 | + cache-to: type=gha,scope=floci,mode=max |
| 49 | + |
| 50 | + - name: Compress image |
| 51 | + run: gzip /tmp/floci-image.tar |
| 52 | + |
| 53 | + - name: Upload floci image |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + with: |
| 56 | + name: floci-image |
| 57 | + path: /tmp/floci-image.tar.gz |
| 58 | + retention-days: 1 |
| 59 | + |
| 60 | + compat-test: |
| 61 | + name: ${{ matrix.test }} |
| 62 | + needs: build |
| 63 | + runs-on: ubuntu-latest |
| 64 | + timeout-minutes: 20 |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: |
| 68 | + test: |
| 69 | + - sdk-test-node |
| 70 | + - sdk-test-python |
| 71 | + - sdk-test-java |
| 72 | + - sdk-test-go |
| 73 | + - sdk-test-rust |
| 74 | + - sdk-test-awscli |
| 75 | + - compat-cdk |
| 76 | + - compat-terraform |
| 77 | + - compat-opentofu |
| 78 | + |
| 79 | + steps: |
| 80 | + - name: Download floci image |
| 81 | + uses: actions/download-artifact@v4 |
| 82 | + with: |
| 83 | + name: floci-image |
| 84 | + path: /tmp |
| 85 | + |
| 86 | + - name: Load floci image |
| 87 | + run: gunzip -c /tmp/floci-image.tar.gz | docker load |
| 88 | + |
| 89 | + - name: Create Docker network |
| 90 | + run: docker network create compat-net |
| 91 | + |
| 92 | + - name: Start floci |
| 93 | + run: | |
| 94 | + docker run -d --name floci --network compat-net \ |
| 95 | + -p 4566:4566 \ |
| 96 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 97 | + -e FLOCI_SERVICES_DOCKER_NETWORK=compat-net \ |
| 98 | + floci:test |
| 99 | +
|
| 100 | + - name: Wait for floci to be ready |
| 101 | + run: timeout 60 bash -c 'until curl -sf http://localhost:4566/ >/dev/null 2>&1; do sleep 1; done' |
| 102 | + |
| 103 | + - name: Checkout compatibility tests |
| 104 | + uses: actions/checkout@v4 |
| 105 | + with: |
| 106 | + repository: hectorvent/floci-compatibility-tests |
| 107 | + path: compat-tests |
| 108 | + |
| 109 | + - uses: docker/setup-buildx-action@v3 |
| 110 | + |
| 111 | + - name: Build test image |
| 112 | + uses: docker/build-push-action@v6 |
| 113 | + with: |
| 114 | + context: compat-tests/${{ matrix.test }} |
| 115 | + load: true |
| 116 | + tags: compat-${{ matrix.test }} |
| 117 | + cache-from: type=gha,scope=${{ matrix.test }} |
| 118 | + cache-to: type=gha,scope=${{ matrix.test }},mode=max |
| 119 | + |
| 120 | + - name: Run tests |
| 121 | + run: | |
| 122 | + docker run --rm --network compat-net \ |
| 123 | + -e FLOCI_ENDPOINT=http://floci:4566 \ |
| 124 | + compat-${{ matrix.test }} |
| 125 | +
|
| 126 | + - name: Dump floci logs |
| 127 | + if: failure() |
| 128 | + run: docker logs floci |
0 commit comments