Skip to content

Commit

Permalink
extract reusable workflow build-oceanbase-ce (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
whhe authored Jun 25, 2024
1 parent a7915e5 commit 261f85e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 34 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-oceanbase-ce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build oceanbase-ce image

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

jobs:
build-oceanbase-ce:
runs-on: ubuntu-latest
steps:
- 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 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

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.cache_key }}
path: ${{ inputs.image_file }}
39 changes: 5 additions & 34 deletions .github/workflows/test-oceanbase-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,11 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
steps:
- 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 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=4.2.3.1-101000032024061316
- name: Export Docker image
run: docker save -o oceanbase-ce.tar oceanbase-ce

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: oceanbase-ce
path: oceanbase-ce.tar
uses: ./.github/workflows/build-oceanbase-ce.yml
with:
cache_key: oceanbase-ce
image_file: oceanbase-ce.tar
version: 4.2.3.1-101000032024061316

test-slim:
needs: build
Expand Down

0 comments on commit 261f85e

Please sign in to comment.