diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2881516714..368a7b3ae4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,10 +12,30 @@ on: - cron: 0 0 * * * # Allow running manually workflow_dispatch: + push: + branches: + - plt-4246-nightly-tests jobs: + check-deploy: + runs-on: ubuntu-latest + steps: + - name: Check deploy + run: | + CURRENT_DEPLOY=$(curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/input-output-hk/marlowe-cardano/actions/workflows/deploy.yml/runs\?per_page\=1\&branch\=main\&status\=success | jq --raw-output '.workflow_runs[0].head_sha') + if [ $CURRENT_DEPLOY != $GITHUB_SHA ]; + then + echo "Unable to run nightly tests on $GITHUB_SHA, currently deployed commit is $CURRENT_DEPLOY" + exit 1 + fi + marlowe-finder: runs-on: ubuntu-latest + needs: [check-deploy] steps: - name: Checkout uses: actions/checkout@v3 @@ -55,8 +75,10 @@ jobs: : done result/bin/marlowe-finder --end-at-tip + marlowe-scaling: runs-on: ubuntu-latest + needs: [check-deploy] steps: - name: Checkout uses: actions/checkout@v3