update-tests-expected-runtime #143
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
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@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: ./.github/actions/setup-nca-env | |
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f | |
with: | |
workflow: test-push.yml | |
workflow_conclusion: completed | |
name: k8s-log | |
path: tests/ | |
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f | |
with: | |
workflow: test-push.yml | |
workflow_conclusion: completed | |
name: calico-log | |
path: tests/ | |
- uses: dawidd6/action-download-artifact@7132ab516fba5f602fafae6fdd4822afa10db76f | |
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 ) |