image_updated #620
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
name: Jepsen CI on Repository Dispatch | |
on: | |
repository_dispatch: | |
branches: [master] | |
types: image_updated | |
jobs: | |
jepsen-test: | |
runs-on: ubuntu-latest | |
name: The simplest jepsen test for HStreamDB | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- name: Prepare environment for test | |
run: | | |
cd ./docker | |
./init-secret.sh | |
- name: Build base image | |
run: | | |
docker build -t jepsen-hstream:base ./docker/base/ | |
- name: Build test images | |
run: | | |
docker-compose --file ./docker/docker-compose.yml \ | |
--compatibility \ | |
-p jepsen \ | |
build | |
- name: Clean dangling images | |
run: | | |
docker image prune -f | |
- name: Check disk space | |
run: | | |
df -h | |
- name: Start test cluster and run jepsen test | |
run: | | |
docker-compose --file ./docker/docker-compose.yml \ | |
--compatibility \ | |
-p jepsen \ | |
up \ | |
--renew-anon-volumes \ | |
--exit-code-from control | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v2 | |
if: ${{ success() }} || ${{ failure() }} | |
with: | |
name: jepsen-test-result | |
path: | | |
store/HStream | |
/tmp/*.log | |
!store/HStream/latest | |
- 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/hstream/commit/${{ github.event.client_payload.commit_sha }}", | |
"Action summary": "https://github.com/'"$GITHUB_REPOSITORY"'/actions/runs/'"$GITHUB_RUN_ID"'"}' |