generated from IBM/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (58 loc) · 2.32 KB
/
update-tests-expected-runtime.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
name: update-tests-expected-runtime
on:
workflow_dispatch: # manual triggering
permissions:
actions: read
contents: read
jobs:
changed-tests:
runs-on: ubuntu-latest
outputs:
changed_tests: ${{ steps.changes.outputs.changed_tests}}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
fetch-depth: 0
- uses: ./.github/actions/setup-nca-env
- name: get added or modified tests
id: changes
run: |
echo "::set-output name=changed_tests::$(((git fetch origin master:master) && (git diff --name-only --diff-filter=AMRD master)) | grep -E '*-scheme\.yaml|k8s_cmdline_tests.yaml' | xargs)"
update-tests-runtime:
runs-on: ubuntu-latest
permissions:
contents: write
needs: changed-tests
if: ${{needs.changed-tests.outputs.changed_tests}}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: ./.github/actions/setup-nca-env
- uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: test-push.yml
workflow_conclusion: completed
name: k8s-log
path: tests/
- uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: test-push.yml
workflow_conclusion: completed
name: calico-log
path: tests/
- uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: test-push.yml
workflow_conclusion: completed
name: istio-log
path: tests/
- name: run script to update expected run time
run: |
export PYTHONPATH=.
python tests/update_expected_runtime.py --changed_tests ${{needs.changed-tests.outputs.changed_tests}}
rm tests/*_log.txt
- name: Commit changes
run: |
git config user.name ${{ github.actor }}
git config user.email '${{ github.actor }}@users.noreply.github.com'
git add tests/expected_runtime/calico_tests_expected_runtime.csv tests/expected_runtime/istio_tests_expected_runtime.csv tests/expected_runtime/k8s_tests_expected_runtime.csv
git diff-index --quiet HEAD || ( git commit -m"Updating expected-runtimes file" && git push )