blob: b7dde272c3d95a0d8ec0710dda37e5e8c449b606 [file]
---
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
# 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
steps:
- name: Checkout the code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Validate etcd_ref input
env:
ETCD_REF: ${{ inputs.etcd_ref }}
run: |
if [[ -n "$ETCD_REF" && ! "$ETCD_REF" =~ ^[A-Za-z0-9._/-]+$ ]]; then
echo "::error::Invalid etcd_ref '$ETCD_REF': only alphanumeric characters, '.', '_', '-', and '/' are allowed"
exit 1
fi
- name: Login to Antithesis Docker Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ${{ env.REGISTRY }}
username: _json_key
password: ${{ secrets.ANTITHESIS_CONTAINER_REGISTRY_TOKEN }}
- name: Build and push config image
working-directory: ./tests/antithesis
env:
ETCD_REF: ${{ inputs.etcd_ref || 'main' }}
run: |
IMAGE_TAG="${ETCD_REF}_${{ github.sha }}"
make antithesis-build-config-image IMAGE_TAG="$IMAGE_TAG"
IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-config:${IMAGE_TAG}"
docker tag etcd-config:latest "$IMAGE"
docker push "$IMAGE"
- name: Build and push client image
working-directory: ./tests/antithesis
env:
ETCD_REF: ${{ inputs.etcd_ref || 'main' }}
run: |
make antithesis-build-client-docker-image
IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-client:${ETCD_REF}_${{ github.sha }}"
docker tag etcd-client:latest "$IMAGE"
docker push "$IMAGE"
- name: Build and push etcd image
working-directory: ./tests/antithesis
env:
ETCD_REF: ${{ inputs.etcd_ref || 'main' }}
run: |
make antithesis-build-etcd-image REF="$ETCD_REF"
IMAGE="${{ env.REGISTRY }}/${{ env.REPOSITORY }}/etcd-server:${ETCD_REF}_${{ github.sha }}"
docker tag etcd-server:latest "$IMAGE"
docker push "$IMAGE"
- name: Run Antithesis Tests
uses: antithesishq/antithesis-trigger-action@80a5e9be591d303bf3c83e3ecbdc00102ad9de90 # v0.12
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 || 'siarkowicz@google.com' }}
test_name: ${{ inputs.test || 'etcd nightly antithesis run' }}
additional_parameters: |-
custom.duration = ${{ inputs.duration || 12 }}
antithesis.source = ${{ inputs.etcd_ref || 'main' }}