Skip to content

Commit

Permalink
ci: hornbill (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Commelina authored Jul 15, 2024
1 parent 03445c7 commit 165af45
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,49 @@ jobs:
!store/current/
!store/latest/
retention-days: 7

hornbill-test:
runs-on: ubuntu-latest
name: Jepsen test for hornbill
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Prepare environment for test
run: |
cd ./docker
./init-secret.sh
- name: Build base image
run: |
./scripts/build_hornbill_base.sh
- name: Build test images (hornbill)
run: |
./scripts/build_hornbill.sh
- name: Check disk space
run: |
df -h
- name: Start test cluster and run jepsen test (hornbill)
run: |
./scripts/up_hornbill.sh
- name: Cleanup resources (hornbill)
run: |
./scripts/clean_hornbill.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: hornbill-result
path: |
store/
/tmp/*.log
!store/current/
!store/latest/
retention-days: 7
67 changes: 67 additions & 0 deletions .github/workflows/ci_repo_dispatch_hornbill.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Jepsen CI on Repository Dispatch (Hornbill)
on:
repository_dispatch:
branches: [master]
types: hornbill_image_updated

jobs:
hornbill-test:
runs-on: ubuntu-latest
name: Jepsen test for hornbill
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Prepare environment for test
run: |
cd ./docker
./init-secret.sh
- name: Build base image
run: |
./scripts/build_hornbill_base.sh
- name: Build test images (hornbill)
run: |
./scripts/build_hornbill.sh
- name: Check disk space
run: |
df -h
- name: Start test cluster and run jepsen test (hornbill)
run: |
./scripts/up_hornbill.sh
- name: Cleanup resources (hornbill)
run: |
./scripts/clean_hornbill.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: hornbill-result
path: |
store/
/tmp/*.log
!store/current/
!store/latest/
retention-days: 7

- name: Post to Slack channel
if: ${{ success() }} || ${{ failure() }}
run: |
if [ "${{ job.status }}" = 'success' ]
then JOB_STATUS_EMOJI=':white_check_mark:'
else JOB_STATUS_EMOJI=':x:'
fi
curl \
-X POST \
-H 'Content-Type: application/json' \
${{ secrets.SLACK_WEBHOOK_URL }} \
--data '{"GitHub Action build result": "${{ job.status }} '"$JOB_STATUS_EMOJI"'",
"Commit info": "https://github.com/hstreamdb/hornbill/commit/${{ github.event.client_payload.commit_sha }}",
"Action summary": "https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"}'
2 changes: 1 addition & 1 deletion scripts/build_hornbill_base.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/bash
docker build -t jepsen-hornbill:base \
--build-arg "USE_CHINA_MIRROR=false" \
--build-arg "HORNBILL_IMAGE=ghcr.io/hstreamdb/hornbill:v1.0.0-m0" \
--build-arg "HORNBILL_IMAGE=ghcr.io/hstreamdb/hornbill:latest" \
./docker/base-hornbill

0 comments on commit 165af45

Please sign in to comment.