Skip to content

Build and trigger Antithesis exploration #44

Build and trigger Antithesis exploration

Build and trigger Antithesis exploration #44

---
name: Build and trigger Antithesis exploration
on:
# pull_request:
# branches: [main]
schedule:
- cron: "0 0 * * *" # run every day at midnight
workflow_dispatch:
inputs:
test:
description: 'Test name'
required: false
type: string
duration:
description: 'Duration (exploration hours)'
required: true
type: int
description:
description: 'Description (avoid quotes, please!)'
required: true
type: string
etcd_ref:
description: 'etcd version to build etcd-server from'
required: false
type: string
email:
description: 'Additional email notification recipient (separate with ;)'
required: true
type: string
cfg_node_count:
description: 'Number of nodes in the etcd cluster'
required: false
type: int
# Declare default permissions as read only.
permissions: read-all
env:
REGISTRY: us-central1-docker.pkg.dev
REPOSITORY: molten-verve-216720/linuxfoundation-repository
jobs:
build-and-push-and-test:
runs-on: ubuntu-latest
environment: Antithesis
env:
CFG_NODE_COUNT: ${{ inputs.cfg_node_count || 3 }}
steps:
- name: Checkout the code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Login to Antithesis Docker Registry
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ${{ env.REGISTRY }}
username: _json_key
password: ${{ secrets.ANTITHESIS_CONTAINER_REGISTRY_TOKEN }}
- name: Build and push config image
working-directory: ./tests/antithesis
run: |
make antithesis-build-config-image IMAGE_TAG=${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}
export IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-config:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}"
docker tag etcd-config:latest $IMAGE
docker push $IMAGE
- name: Build and push client image
working-directory: ./tests/antithesis
run: |
make antithesis-build-client-docker-image
export IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-client:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}"
docker tag etcd-client:latest $IMAGE
docker push $IMAGE
- name: Build and push etcd image
working-directory: ./tests/antithesis
run: |
make antithesis-build-etcd-image REF=${{ inputs.etcd_ref || 'main' }}
export IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-server:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}"
docker tag etcd-server:latest $IMAGE
docker push $IMAGE
- name: Run Antithesis Tests
uses: antithesishq/antithesis-trigger-action@6c0a27302c0a3cd97d87d40bd6704e673abed4bb # v0.9
with:
notebook_name: etcd
tenant: linuxfoundation
username: ${{ secrets.ANTITHESIS_WEBHOOK_USERNAME }}
password: ${{ secrets.ANTITHESIS_WEBHOOK_PASSWORD }}
github_token: ${{ secrets.GH_PAT }}
config_image: us-central1-docker.pkg.dev/molten-verve-216720/linuxfoundation-repository/etcd-config:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}
images: us-central1-docker.pkg.dev/molten-verve-216720/linuxfoundation-repository/etcd-client:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }};us-central1-docker.pkg.dev/molten-verve-216720/linuxfoundation-repository/etcd-server:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }};docker.io/library/ubuntu:latest;us-central1-docker.pkg.dev/molten-verve-216720/linuxfoundation-repository/etcd-config:${{ inputs.etcd_ref || 'main' }}_${{ github.sha }}
description: ${{ inputs.description || 'etcd nightly antithesis run' }}
email_recipients: ${{ inputs.email || '[email protected]' }}
test_name: ${{ inputs.test || 'etcd nightly antithesis run' }}
additional_parameters: |-
custom.duration = ${{ inputs.duration || 12 }}
antithesis.source = ${{ inputs.etcd_ref || 'main' }}