-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add oceanbase-ce CI workflow (#5)
- Loading branch information
Showing
2 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: oceanbase-ce | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/ci-oceanbase-ce.yml' | ||
- 'oceanbase-ce/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/ci-oceanbase-ce.yml' | ||
- 'oceanbase-ce/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker image | ||
run: ./oceanbase-ce/docker_build.sh | ||
|
||
- 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 | ||
|
||
test-slim: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: oceanbase-ce | ||
path: /tmp | ||
|
||
- name: Load Docker image | ||
run: docker load -i /tmp/oceanbase-ce.tar | ||
|
||
- name: Start Docker container | ||
uses: oceanbase/setup-oceanbase-ce@v1 | ||
with: | ||
image_name: oceanbase-ce | ||
container_name: ob-slim | ||
fastboot: false | ||
|
||
- name: Test Docker container | ||
run: | | ||
docker exec ob-slim obclient -h127.0.0.1 -P2881 -uroot -e 'select version()' | ||
docker exec ob-slim obclient -h127.0.0.1 -P2881 -uroot@test -e 'show databases' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters