From 67cb8218a46e91dc7561e0d270b111c2caed9cd7 Mon Sep 17 00:00:00 2001 From: He Wang Date: Wed, 21 Aug 2024 11:34:25 +0800 Subject: [PATCH] refactor: add reusable workflows to build, test and release oceanbase-ce --- .../workflows/release-lts-oceanbase-ce.yml | 97 +++-------------- .github/workflows/release-oceanbase-ce.yml | 87 +++------------ .../reusable-build-and-test-oceanbase-ce.yml | 45 ++++++++ .../reusable-build-oblogproxy-ce.yml | 49 +++++++++ ...ce.yml => reusable-build-oceanbase-ce.yml} | 24 ++--- .../reusable-release-oceanbase-ce.yml | 101 ++++++++++++++++++ ...-ce.yml => reusable-test-oceanbase-ce.yml} | 13 ++- .github/workflows/test-oblogproxy-ce.yml | 80 ++++---------- .github/workflows/test-oceanbase-ce.yml | 40 +------ 9 files changed, 267 insertions(+), 269 deletions(-) create mode 100644 .github/workflows/reusable-build-and-test-oceanbase-ce.yml create mode 100644 .github/workflows/reusable-build-oblogproxy-ce.yml rename .github/workflows/{build-oceanbase-ce.yml => reusable-build-oceanbase-ce.yml} (73%) create mode 100644 .github/workflows/reusable-release-oceanbase-ce.yml rename .github/workflows/{java-test-oceanbase-ce.yml => reusable-test-oceanbase-ce.yml} (93%) diff --git a/.github/workflows/release-lts-oceanbase-ce.yml b/.github/workflows/release-lts-oceanbase-ce.yml index 39b0fc9..f61886c 100644 --- a/.github/workflows/release-lts-oceanbase-ce.yml +++ b/.github/workflows/release-lts-oceanbase-ce.yml @@ -10,89 +10,26 @@ env: tagName: ${{ github.ref_name }} jobs: - release-lts-oceanbase-ce: + set-version: runs-on: ubuntu-latest + outputs: + version: ${{ steps.set_version_vars.outputs.version }} steps: - - name: Free disk space on Ubuntu runner - uses: kfir4444/free-disk-space@main - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - swap-storage: true - - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set Version variables id: set_version_vars run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*\.\d*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT - - name: Set LTS tag variables - id: set_lts_tag_vars - run: echo "lts_tag=$(echo $tagName | grep -P '(\d*\.\d*\.\d*)' --only-matching)" >> $GITHUB_OUTPUT - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Log in to Quay io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_IO_USERNAME }} - password: ${{ secrets.QUAY_IO_PASSWORD }} - - - name: Log in to Ghcr io - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build pre image - uses: docker/build-push-action@v6 - with: - context: ./oceanbase-ce - platforms: linux/amd64 - file: ./oceanbase-ce/Dockerfile.pre - push: false - load: true - tags: oceanbase-ce-pre - build-args: | - VERSION=${{ steps.set_version_vars.outputs.version }} - - - name: Copy storage files - run: | - mkdir -p ./oceanbase-ce/share - docker run -v ./oceanbase-ce/share:/root/share oceanbase-ce-pre - - - name: Build and push observer w/o cache - uses: docker/build-push-action@v6 - with: - context: ./oceanbase-ce - platforms: linux/amd64,linux/arm64 - file: ./oceanbase-ce/Dockerfile - push: true - tags: | - ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ steps.set_lts_tag_vars.outputs.lts_tag }}-lts - quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ steps.set_lts_tag_vars.outputs.lts_tag }}-lts - ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ steps.set_lts_tag_vars.outputs.lts_tag }}-lts - ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest - quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest - ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest - build-args: | - VERSION=${{ steps.set_version_vars.outputs.version }} + build-and-test: + uses: ./.github/workflows/reusable-build-and-test-oceanbase-ce.yml + needs: set-version + with: + cache_key: release-lts-oceanbase-ce + version: ${{ needs.set-version.outputs.version }} + + release: + uses: ./.github/workflows/reusable-release-oceanbase-ce.yml + needs: build-and-test + with: + cache_key: release-lts-oceanbase-ce + version: ${{ needs.set-version.outputs.version }} + lts: true diff --git a/.github/workflows/release-oceanbase-ce.yml b/.github/workflows/release-oceanbase-ce.yml index 5c1006f..30e1a7d 100644 --- a/.github/workflows/release-oceanbase-ce.yml +++ b/.github/workflows/release-oceanbase-ce.yml @@ -10,79 +10,26 @@ env: tagName: ${{ github.ref_name }} jobs: - release-oceanbase-ce: + set-version: runs-on: ubuntu-latest + outputs: + version: ${{ steps.set_version_vars.outputs.version }} steps: - - name: Free disk space on Ubuntu runner - uses: kfir4444/free-disk-space@main - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - swap-storage: true - - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set Version variables id: set_version_vars run: echo "version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*\.\d*-\d{18})' --only-matching)" >> $GITHUB_OUTPUT - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Log in to Quay io - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_IO_USERNAME }} - password: ${{ secrets.QUAY_IO_PASSWORD }} - - - name: Log in to Ghcr io - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build pre image - uses: docker/build-push-action@v6 - with: - context: ./oceanbase-ce - platforms: linux/amd64 - file: ./oceanbase-ce/Dockerfile.pre - push: false - load: true - tags: oceanbase-ce-pre - build-args: | - VERSION=${{ steps.set_version_vars.outputs.version }} - - - name: Copy storage files - run: | - mkdir -p ./oceanbase-ce/share - docker run -v ./oceanbase-ce/share:/root/share oceanbase-ce-pre - - - name: Build and push observer w/o cache - uses: docker/build-push-action@v6 - with: - context: ./oceanbase-ce - platforms: linux/amd64,linux/arm64 - file: ./oceanbase-ce/Dockerfile - push: true - tags: | - ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ steps.set_version_vars.outputs.version }} - build-args: | - VERSION=${{ steps.set_version_vars.outputs.version }} + build-and-test: + uses: ./.github/workflows/reusable-build-and-test-oceanbase-ce.yml + needs: set-version + with: + cache_key: release-oceanbase-ce + version: ${{ needs.set-version.outputs.version }} + + release: + uses: ./.github/workflows/reusable-release-oceanbase-ce.yml + needs: build-and-test + with: + cache_key: release-oceanbase-ce + version: ${{ needs.set-version.outputs.version }} + lts: false diff --git a/.github/workflows/reusable-build-and-test-oceanbase-ce.yml b/.github/workflows/reusable-build-and-test-oceanbase-ce.yml new file mode 100644 index 0000000..841492f --- /dev/null +++ b/.github/workflows/reusable-build-and-test-oceanbase-ce.yml @@ -0,0 +1,45 @@ +name: build and test oceanbase-ce + +on: + workflow_call: + inputs: + cache_key: + required: true + type: string + version: + required: true + type: string + +jobs: + build: + uses: ./.github/workflows/reusable-build-oceanbase-ce.yml + with: + cache_key: ${{ inputs.cache_key }} + version: ${{ inputs.version }} + + test-slim: + needs: build + uses: ./.github/workflows/reusable-test-oceanbase-ce.yml + with: + cache_key: ${{ inputs.cache_key }} + mode: slim + port: 1234 + test_password: 123456 + init_sql: "USE test; + CREATE TABLE user(id INT(10) PRIMARY KEY, name VARCHAR(20)); + INSERT INTO user VALUES (1, 'tom'), (2, 'jerry');" + + test-mini: + needs: build + uses: ./.github/workflows/reusable-test-oceanbase-ce.yml + with: + cache_key: ${{ inputs.cache_key }} + cluster_name: github-action + mode: mini + port: 1234 + sys_password: 1234567 + test_tenant: mini + test_password: 7654321 + init_sql: "USE test; + CREATE TABLE user(id INT(10) PRIMARY KEY, name VARCHAR(20)); + INSERT INTO user VALUES (1, 'tom'), (2, 'jerry');" diff --git a/.github/workflows/reusable-build-oblogproxy-ce.yml b/.github/workflows/reusable-build-oblogproxy-ce.yml new file mode 100644 index 0000000..52687bb --- /dev/null +++ b/.github/workflows/reusable-build-oblogproxy-ce.yml @@ -0,0 +1,49 @@ +name: build oblogproxy-ce image + +on: + workflow_call: + inputs: + cache_key: + required: true + type: string + version: + required: false + type: string + +jobs: + build-oblogproxy-ce-image: + runs-on: ubuntu-latest + steps: + - name: Free disk space on Ubuntu runner + uses: kfir4444/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + + - name: Print environment variables + run: printenv + + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build oblogproxy-ce image + run: | + cd oblogproxy-ce + docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oblogproxy-ce-amd64 --load --output type=docker,dest=./oblogproxy-ce-amd64.tar . + docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oblogproxy-ce-arm64 --load --output type=docker,dest=./oblogproxy-ce-arm64.tar . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.cache_key }} + path: oblogproxy-ce/oblogproxy-ce-**.tar diff --git a/.github/workflows/build-oceanbase-ce.yml b/.github/workflows/reusable-build-oceanbase-ce.yml similarity index 73% rename from .github/workflows/build-oceanbase-ce.yml rename to .github/workflows/reusable-build-oceanbase-ce.yml index a82a105..3db61d1 100644 --- a/.github/workflows/build-oceanbase-ce.yml +++ b/.github/workflows/reusable-build-oceanbase-ce.yml @@ -6,15 +6,12 @@ on: cache_key: required: true type: string - image_file: - required: true - type: string version: required: true type: string jobs: - build-oceanbase-ce: + build-oceanbase-ce-image: runs-on: ubuntu-latest steps: - name: Free disk space on Ubuntu runner @@ -57,22 +54,13 @@ jobs: docker run -v ./oceanbase-ce/share:/root/share oceanbase-ce-pre - name: Build observer image - uses: docker/build-push-action@v6 - with: - context: ./oceanbase-ce - platforms: linux/amd64 - file: ./oceanbase-ce/Dockerfile - push: false - load: true - tags: oceanbase-ce - build-args: | - VERSION=${{ inputs.version }} - - - name: Export Docker image - run: docker save -o ${{ inputs.image_file }} oceanbase-ce + run: | + cd oceanbase-ce + docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/amd64 -t oceanbase-ce-amd64 --load --output type=docker,dest=./oceanbase-ce-amd64.tar . + docker buildx build --build-arg VERSION=${{ inputs.version }} --platform linux/arm64 -t oceanbase-ce-arm64 --load --output type=docker,dest=./oceanbase-ce-arm64.tar . - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ inputs.cache_key }} - path: ${{ inputs.image_file }} + path: oceanbase-ce/oceanbase-ce-**.tar diff --git a/.github/workflows/reusable-release-oceanbase-ce.yml b/.github/workflows/reusable-release-oceanbase-ce.yml new file mode 100644 index 0000000..8f38902 --- /dev/null +++ b/.github/workflows/reusable-release-oceanbase-ce.yml @@ -0,0 +1,101 @@ +name: release oceanbase-ce image + +on: + workflow_call: + inputs: + cache_key: + required: true + type: string + version: + required: true + type: string + lts: + required: true + type: boolean + +jobs: + release-oceanbase-ce: + runs-on: ubuntu-latest + steps: + - name: Free disk space on Ubuntu runner + uses: kfir4444/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to Quay io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_IO_USERNAME }} + password: ${{ secrets.QUAY_IO_PASSWORD }} + + - name: Log in to Ghcr io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.cache_key }} + path: /tmp + + - name: Load observer images + run: | + docker load -i /tmp/oceanbase-ce-amd64.tar + rm -f /tmp/oceanbase-ce-amd64.tar + docker load -i /tmp/oceanbase-ce-arm64.tar + rm -f /tmp/oceanbase-ce-arm64.tar + + - name: Publish observer images with version tag + run: | + docker buildx imagetools create --tag oceanbase-ce oceanbase-ce-amd64 oceanbase-ce-arm64 + + docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }} + docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }} + + docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }} + docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:${{ inputs.version }} + + docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }} + docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:${{ inputs.version }} + + - name: Publish observer images with lts tag + if: ${{ inputs.lts }} + run: | + lts_version=$(echo $tagName | grep -P '(\d*\.\d*\.\d*)' --only-matching) + lts_tag="${lts_version}-lts" + + docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:$lts_tag + docker tag oceanbase-ce ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest + docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:$lts_tag + docker push ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-ce:latest + + docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:$lts_tag + docker tag oceanbase-ce quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest + docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:$lts_tag + docker push quay.io/${{ vars.QUAY_IO_PUSH_BASE }}/oceanbase-ce:latest + + docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:$lts_tag + docker tag oceanbase-ce ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest + docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:$lts_tag + docker push ghcr.io/${{ github.repository_owner }}/oceanbase-ce:latest diff --git a/.github/workflows/java-test-oceanbase-ce.yml b/.github/workflows/reusable-test-oceanbase-ce.yml similarity index 93% rename from .github/workflows/java-test-oceanbase-ce.yml rename to .github/workflows/reusable-test-oceanbase-ce.yml index c5202fe..6f71d0e 100644 --- a/.github/workflows/java-test-oceanbase-ce.yml +++ b/.github/workflows/reusable-test-oceanbase-ce.yml @@ -1,4 +1,4 @@ -name: java test oceanbase-ce +name: test oceanbase-ce container on: workflow_call: @@ -6,9 +6,6 @@ on: cache_key: required: true type: string - image_file: - required: true - type: string mode: required: true type: string @@ -37,7 +34,7 @@ on: default: '' jobs: - test-oceanbase-ce: + test-oceanbase-ce-container: runs-on: ubuntu-latest steps: - name: Free disk space on Ubuntu runner @@ -57,12 +54,14 @@ jobs: path: /tmp - name: Load Docker image - run: docker load -i /tmp/${{ inputs.image_file }} + run: | + docker load -i /tmp/oceanbase-ce-amd64.tar + rm -f /tmp/oceanbase-ce-amd64.tar - name: Start Docker container uses: oceanbase/setup-oceanbase-ce@v1 with: - image_name: oceanbase-ce + image_name: oceanbase-ce-amd64 container_name: oceanbase-ce mode: ${{ inputs.mode }} cluster_name: ${{ inputs.cluster_name }} diff --git a/.github/workflows/test-oblogproxy-ce.yml b/.github/workflows/test-oblogproxy-ce.yml index fb458ff..938bdb8 100644 --- a/.github/workflows/test-oblogproxy-ce.yml +++ b/.github/workflows/test-oblogproxy-ce.yml @@ -3,13 +3,9 @@ name: test oblogproxy-ce on: pull_request: paths: - - '.github/workflows/**-oblogproxy-ce.yml' - - '.github/workflows/build-oceanbase-ce.yml' - - 'oblogproxy-ce/Dockerfile' - - 'oblogproxy-ce/**.sh' - - 'oceanbase-ce/Dockerfile' - - 'oceanbase-ce/**.sh' - - 'oceanbase-ce/**.yaml' + - '.github/workflows/reusable-build-oceanbase-ce-image.yml' + - '.github/workflows/*oblogproxy-ce*.yml' + - 'oblogproxy-ce/**' - 'test/**/LogProxyCETest.java' concurrency: @@ -17,73 +13,41 @@ concurrency: cancel-in-progress: true jobs: - build-oceanbase-ce: - uses: ./.github/workflows/build-oceanbase-ce.yml - with: - cache_key: test-oblogproxy-ce_oceanbase-ce - image_file: oceanbase-ce.tar - version: 4.2.1.8-108000022024072217 - build-oblogproxy-ce: - runs-on: ubuntu-latest - steps: - - name: Clean tool cache - run: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Print environment variables - run: printenv - - - name: Check out repository code - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build oblogproxy-ce image - uses: docker/build-push-action@v6 - with: - context: ./oblogproxy-ce - platforms: linux/amd64 - file: ./oblogproxy-ce/Dockerfile - push: false - load: true - tags: oblogproxy-ce - - - name: Export Docker image - run: docker save -o oblogproxy-ce.tar oblogproxy-ce - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: test-oblogproxy-ce_oblogproxy-ce - path: oblogproxy-ce.tar + uses: ./.github/workflows/reusable-build-oblogproxy-ce.yml + with: + cache_key: test-oblogproxy-ce test-oblogproxy-ce: runs-on: ubuntu-latest - needs: [ build-oceanbase-ce, build-oblogproxy-ce ] + needs: [ build-oblogproxy-ce ] steps: - - name: Clean tool cache - run: sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Free disk space on Ubuntu runner + uses: kfir4444/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true - name: Download artifact uses: actions/download-artifact@v4 with: - pattern: test-oblogproxy-ce_** + name: test-oblogproxy-ce path: /tmp - name: Load Docker image run: | - docker load -i /tmp/test-oblogproxy-ce_oceanbase-ce/oceanbase-ce.tar - docker load -i /tmp/test-oblogproxy-ce_oblogproxy-ce/oblogproxy-ce.tar - sudo rm -rf /tmp/* + docker load -i /tmp/oblogproxy-ce-amd64.tar + rm -f /tmp/oblogproxy-ce-**.tar - name: Start oceanbase-ce container uses: oceanbase/setup-oceanbase-ce@v1 with: - image_name: oceanbase-ce + image_name: oceanbase/oceanbase-ce + image_tag: 4.2.1.8-108000022024072217 container_name: oceanbase-ce sql_port: 12881 rpc_port: 12882 @@ -92,7 +56,7 @@ jobs: tenant_root_password: 654321 - name: Start oblogproxy-ce container - run: docker run --name oblogproxy-ce -e OB_SYS_USERNAME=root -e OB_SYS_PASSWORD=123456 -p 12983:2983 -d oblogproxy-ce + run: docker run --name oblogproxy-ce -e OB_SYS_USERNAME=root -e OB_SYS_PASSWORD=123456 -p 12983:2983 -d oblogproxy-ce-amd64 - name: Set container IP id: set_container_ip diff --git a/.github/workflows/test-oceanbase-ce.yml b/.github/workflows/test-oceanbase-ce.yml index 42bae9c..a63188f 100644 --- a/.github/workflows/test-oceanbase-ce.yml +++ b/.github/workflows/test-oceanbase-ce.yml @@ -3,10 +3,8 @@ name: test oceanbase-ce on: pull_request: paths: - - '.github/workflows/**-oceanbase-ce.yml' - - 'oceanbase-ce/Dockerfile' - - 'oceanbase-ce/**.sh' - - 'oceanbase-ce/**.yaml' + - '.github/workflows/*oceanbase-ce*.yml' + - 'oceanbase-ce/**' - 'test/**/OceanBaseCETest.java' concurrency: @@ -14,38 +12,8 @@ concurrency: cancel-in-progress: true jobs: - build: - uses: ./.github/workflows/build-oceanbase-ce.yml + build-and-test: + uses: ./.github/workflows/reusable-build-and-test-oceanbase-ce.yml with: cache_key: test-oceanbase-ce - image_file: oceanbase-ce.tar version: 4.3.2.0-100000092024072912 - - test-slim: - needs: build - uses: ./.github/workflows/java-test-oceanbase-ce.yml - with: - cache_key: test-oceanbase-ce - image_file: oceanbase-ce.tar - mode: slim - port: 1234 - test_password: 123456 - init_sql: "USE test; - CREATE TABLE user(id INT(10) PRIMARY KEY, name VARCHAR(20)); - INSERT INTO user VALUES (1, 'tom'), (2, 'jerry');" - - test-mini: - needs: build - uses: ./.github/workflows/java-test-oceanbase-ce.yml - with: - cache_key: test-oceanbase-ce - image_file: oceanbase-ce.tar - cluster_name: github-action - mode: mini - port: 1234 - sys_password: 1234567 - test_tenant: mini - test_password: 7654321 - init_sql: "USE test; - CREATE TABLE user(id INT(10) PRIMARY KEY, name VARCHAR(20)); - INSERT INTO user VALUES (1, 'tom'), (2, 'jerry');"