-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (81 loc) · 3.13 KB
/
run-manual.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Run manual test
on:
workflow_dispatch:
inputs:
overrideTests:
description: 'Test IDs to run (eg. test1,test2)'
default: ""
type: string
overrideClientPairs:
description: 'Override client pairs to run this test with (eg. lighthouse-get,teku-besu)'
default: ""
type: string
overrideKurtosisConfig:
description: 'Override kurtosis config to run this test with (eg. kurtosis-config/default.yaml)'
default: ""
type: string
overrideKurtosisBranch:
description: 'Override kurtosis ethereum package branch to run this test with (eg. main)'
default: ""
type: string
jobs:
get_tests:
name: "Load Tests"
runs-on: ubuntu-latest
outputs:
test_configs: ${{ steps.tests.outputs.test_configs }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: "Load test configurations from tests.yaml"
id: tests
shell: bash
run: |
tests_file="tests.yaml"
override_tests="${{ inputs.overrideTests }}"
override_pairs="${{ inputs.overrideClientPairs }}"
override_kurtosis_config="${{ inputs.overrideKurtosisConfig }}"
override_kurtosis_branch="${{ inputs.overrideKurtosisBranch }}"
test_configs="$(cat $tests_file | yq -o json | jq -c '.tests')"
if [ -z "$override_tests" ]; then
test_configs="$(echo "$test_configs" | jq -c "map(select(.schedule == true))")"
else
# filter by tests
filter_str=""
while read test; do
if ! [ -z "$filter_str" ]; then
filter_str="$filter_str or"
fi
filter_str="$filter_str .id == \"$test\""
done <<< $(echo "$override_tests" | tr "," "\n")
test_configs="$(echo "$test_configs" | jq -c "map(select($filter_str))")"
fi
if ! [ -z "$override_pairs" ]; then
test_configs="$(echo "$test_configs" | jq -c "(.[]).clientPairs |= [\"$override_pairs\"]")"
fi
if ! [ -z "$override_kurtosis_config" ]; then
test_configs="$(echo "$test_configs" | jq -c "(.[]).kurtosis = \"$override_kurtosis_config\"")"
fi
if ! [ -z "$override_kurtosis_branch" ]; then
test_configs="$(echo "$test_configs" | jq -c "(.[]).kurtosis_branch = \"$override_kurtosis_branch\"")"
fi
echo "test_configs<<EOF" >> $GITHUB_OUTPUT
echo "$test_configs" >> $GITHUB_OUTPUT
echo "$(echo "$test_configs" | jq)"
echo "EOF" >> $GITHUB_OUTPUT
run_tests:
needs: get_tests
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) }}
#use_chatgpt: '{"url": "${{ vars.CHATGPT_URL }}", "model": "${{ vars.CHATGPT_MODEL }}"}'
secrets:
RANCHER_URL: ${{ secrets.RANCHER_URL }}
RANCHER_TOKEN: ${{ secrets.RANCHER_TOKEN }}
DISCORD_HOOK: ${{ secrets.DISCORD_WEBHOOK }}
CHATGPT_KEY: ${{ secrets.CHATGPT_KEY }}