Skip to content

Permutation Testing #36

Permutation Testing

Permutation Testing #36

name: Permutation Testing
on:
schedule:
# Run every Tuesday at 20:00 UTC
- cron: '0 20 * * 2'
workflow_dispatch: # Allow manual triggering
permissions:
contents: read
jobs:
permutation-test:
name: Run Permutation Tests
# Uses AWS CodeBuild managed runners for higher memory capacity (64GB)
# The permutation tests are memory-intensive and require more resources than standard GitHub runners
runs-on:
- codebuild-ThorGHA-${{ github.run_id }}-${{ github.run_attempt }}
- image:arm-3.0
- instance-size:xlarge # 32 vCPUs, 64 GiB memory
timeout-minutes: 240 # 4 hours
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
- name: Run Permutation Tests
env:
RUN_PERMUTATIONS: "1"
run: go test -v -timeout=4h ./builtin/staker -run TestRandomPermutationManager
notify-slack:
name: Notify Slack on Failure
needs: permutation-test
if: always() && needs.permutation-test.result != 'success'
runs-on: ubuntu-latest
steps:
- name: Notify Slack
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
payload: |
{
"text": ":alert: Permutation Testing Failed",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":alert: *Permutation Testing Failed*\n\nThe weekly permutation tests have failed. Please check the logs for details."
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n${{ github.repository }}"
},
{
"type": "mrkdwn",
"text": "*Status:*\n${{ needs.permutation-test.result == 'failure' && ':x: Failed' || needs.permutation-test.result == 'cancelled' && ':warning: Cancelled' || ':question: Unknown' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n${{ github.ref_name }}"
},
{
"type": "mrkdwn",
"text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>"
}
]
}
]
}