Skip to content

Commit

Permalink
modify workflows structure
Browse files Browse the repository at this point in the history
  • Loading branch information
whhe committed Aug 21, 2024
1 parent 1e8e0d3 commit 01d442f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 50 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/reusable/build-oblogproxy-ce-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: build oblogproxy-ce image

on:
workflow_call:
inputs:
cache_key:
required: true
type: string
image_file:
required: true
type: string

jobs:
build-oblogproxy-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: 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 ${{ inputs.image_file }} oceanbase-ce

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cache_key }}
path: ${{ inputs.image_file }}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: java test oceanbase-ce
name: test oceanbase-ce container

on:
workflow_call:
Expand Down
51 changes: 9 additions & 42 deletions .github/workflows/test-oblogproxy-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ 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/reusable/build-oblogproxy-ce-image.yml'
- '.github/workflows/test-oblogproxy-ce.yml'
- 'oblogproxy-ce/**'
- 'test/**/LogProxyCETest.java'

concurrency:
Expand All @@ -18,48 +15,18 @@ concurrency:

jobs:
build-oceanbase-ce:
uses: ./.github/workflows/build-oceanbase-ce.yml
uses: ./.github/workflows/reusable/build-oceanbase-ce-image.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-image.yml
with:
cache_key: test-oblogproxy-ce_oblogproxy-ce
image_file: oblogproxy-ce.tar

test-oblogproxy-ce:
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: test oceanbase-ce
on:
pull_request:
paths:
- '.github/workflows/**-oceanbase-ce.yml'
- 'oceanbase-ce/Dockerfile'
- 'oceanbase-ce/**.sh'
- 'oceanbase-ce/**.yaml'
- '.github/workflows/reusable/build-oceanbase-ce-image.yml'
- '.github/workflows/reusable/test-oceanbase-ce-container.yml'
- '.github/workflows/test-oceanbase-ce.yml'
- 'oceanbase-ce/**'
- 'test/**/OceanBaseCETest.java'

concurrency:
Expand All @@ -15,15 +15,15 @@ concurrency:

jobs:
build:
uses: ./.github/workflows/build-oceanbase-ce.yml
uses: ./.github/workflows/reusable/build-oceanbase-ce-image.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
uses: ./.github/workflows/reusable/test-oceanbase-ce-container.yml
with:
cache_key: test-oceanbase-ce
image_file: oceanbase-ce.tar
Expand All @@ -36,7 +36,7 @@ jobs:

test-mini:
needs: build
uses: ./.github/workflows/java-test-oceanbase-ce.yml
uses: ./.github/workflows/reusable/test-oceanbase-ce-container.yml
with:
cache_key: test-oceanbase-ce
image_file: oceanbase-ce.tar
Expand Down

0 comments on commit 01d442f

Please sign in to comment.