name: Antithesis experiment

on:
  # Allows the workflow to be triggered manually
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

env:
  ANTITHESIS_PASSWORD: ${{ secrets.ANTITHESIS_PASSWORD }}
  ANTITHESIS_USER: ${{ secrets.ANTITHESIS_USER }}
  ANTITHESIS_TENANT: ${{ secrets.ANTITHESIS_TENANT }}
  ANTITHESIS_PASSWD: ${{ secrets.ANTITHESIS_PASSWD }}
  ANTITHESIS_DOCKER_HOST: us-central1-docker.pkg.dev
  ANTITHESIS_DOCKER_REPO: ${{ secrets.ANTITHESIS_DOCKER_REPO }}
  ANTITHESIS_EMAIL: ${{ secrets.ANTITHESIS_EMAIL }}
  ANTITHESIS_REGISTRY_KEY: ${{ secrets.ANTITHESIS_REGISTRY_KEY }}

jobs:
  test:
    runs-on: blacksmith

    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v3

    - name: Publish workload
      run: bash ./scripts/antithesis/publish-workload.sh

    - name: Publish config
      run: bash ./scripts/antithesis/publish-config.sh

    - name: Launch experiment
      run: bash ./scripts/antithesis/launch.sh
