Skip to content

Retryable Tests

Retryable Tests #13571

Workflow file for this run

name: Retryable Tests
on:
schedule:
- cron: "*/6 * * * *"
pull_request:
branches: [main]
workflow_dispatch:
inputs:
# trunk-ignore(checkov/CKV_GHA_7)
cli-version:
type: string
required: false
description:
The version of `analytics-cli` to use. Defaults to the latest specified in
`analytis-uploader`.
jobs:
test:
runs-on: public-amd64-small
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: install dependencies
run: |
pip install -r requirements.txt
- name: trunk install
uses: trunk-io/trunk-action/[email protected]
with:
tools: gh
- name: download artifact (when retrying)
if: ${{ fromJSON(github.run_attempt) > 1}}
id: download-artifact
uses: dawidd6/action-download-artifact@v6
with:
pr: ${{github.event.pull_request.number}}
name: retry-data
workflow_conclusion: ""
if_no_artifact_found: error
- name: test
id: test
shell: bash
run: behave --junit-directory=python/results --junit python/behave
continue-on-error: true
- name: upload test results
if: ${{ always() }}
uses: ./.github/actions/analytics-uploader-wrapper
with:
token-staging: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
token-prod: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }}
token-dev: ${{ secrets.TRUNK_DEV_ORG_API_TOKEN }}
token-dev2: ${{ secrets.TRUNK_DEV2_ORG_API_TOKEN }}
token-dev3: ${{ secrets.TRUNK_DEV3_ORG_API_TOKEN }}
token-dev4: ${{ secrets.TRUNK_DEV4_ORG_API_TOKEN }}
cli-version: ${{ inputs.cli-version }}
junit-paths: "**/python/results/*-behave.xml"
- name: upload artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: retry-data
path: "**/python/behave/retry.data"
retention-days: 5
- name: trigger job re-run
if:
${{ failure() && steps.test.conclusion == 'failure' && fromJSON(github.run_attempt) < 5}}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yaml -F run_id=${{ github.run_id }}