Skip to content

Run scheduled test #402

Run scheduled test

Run scheduled test #402

Workflow file for this run

name: Run scheduled test
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
concurrency:
group: "scheduled-test"
cancel-in-progress: false
jobs:
get_tests:
name: "Load Tests"
runs-on: ubuntu-latest
outputs:
test_configs: ${{ steps.tests.outputs.test_configs }}
has_docker_tests: ${{ steps.tests.outputs.has_docker_tests }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: "Load test configurations from tests.yaml"
id: tests
shell: bash
run: |
tests_file="tests.yaml"
test_configs="$(cat $tests_file | yq -o json | jq '.tests' | jq -c 'map(select(.schedule == true))')"
echo "test_configs<<EOF" >> $GITHUB_OUTPUT
echo "$test_configs" >> $GITHUB_OUTPUT
echo "$(echo "$test_configs" | jq)"
echo "EOF" >> $GITHUB_OUTPUT
has_docker_tests="false"
if [ $(echo "$test_configs" | jq -c ".[] | select(.backend == \"docker\")" | wc -l) -gt 0 ]; then
has_docker_tests="true"
fi
echo "has_docker_tests=$has_docker_tests" >> $GITHUB_OUTPUT
prepare_cache:
needs: get_tests
if: "${{ needs.get_tests.outputs.has_docker_tests == 'true' }}"
uses: ./.github/workflows/_shared-prepare-docker-cache.yaml
name: "Prepare docker cache"
run_tests:
needs: [get_tests, prepare_cache]
uses: ./.github/workflows/_shared-run.yaml
name: "${{ matrix.config.name }}"
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.get_tests.outputs.test_configs) }}
with:
config: ${{ toJSON(matrix.config) }}
send_notification: "true"
use_chatgpt: '{"url": "${{ vars.CHATGPT_URL }}", "model": "${{ vars.CHATGPT_MODEL }}", "extra_cfg": ${{ vars.CHATGPT_EXTRA_CFG }}}'
secrets:
RANCHER_URL: ${{ secrets.RANCHER_URL }}
RANCHER_TOKEN: ${{ secrets.RANCHER_TOKEN }}
DISCORD_HOOK: ${{ secrets.DISCORD_WEBHOOK }}
CHATGPT_KEY: ${{ secrets.CHATGPT_KEY }}