1919 %% format_file_name(workflow.file_name) %%:
2020 runs-on: %% github_runs_on %%
2121 permissions:
22+ actions: read
2223 contents: read
2324 packages: %% 'read' if (github_registry.url | default(github_default_registry.url)) == 'ghcr.io' else 'none' %%
25+ checks: write
2426 container:
2527 image: %% github_registry.url | default(github_default_registry.url) %%/%% github_image_name %%:%% github_image_tag %%
2628 credentials:
@@ -44,10 +46,43 @@ jobs:
4446 - name: Symlink source checkout to expected location
4547 run: sudo ln -s $PWD/kayobe-config /src
4648
49+ - name: Get Previous Workflow Run
50+ uses: actions/github-script@v6
51+ id: get_previous_run
52+ if: ${{ inputs.run_previous_failed }}
53+ with:
54+ script: |
55+ let result = ${{ inputs.previous_workflow_id || 0 }};
56+ const workflow_id = 'run-tempest.yml';
57+ if (result <= 0) {
58+ const { data: response } = await github.rest.actions.listWorkflowRuns({
59+ owner: context.repo.owner,
60+ repo: context.repo.repo,
61+ workflow_id,
62+ per_page: 2,
63+ });
64+ result = response.workflow_runs[1].id;
65+ }
66+ return result;
67+ result-encoding: string
68+
69+ - name: Download previous Tempest test artifacts
70+ uses: actions/download-artifact@v4
71+ id: previous_artifacts
72+ if: ${{ inputs.run_previous_failed }}
73+ with:
74+ name: tempest-artifacts
75+ github-token: ${{ secrets.GITHUB_TOKEN }}
76+ run-id: ${{ steps.get_previous_run.outputs.result }}
77+
78+ - name: Symlink failed tests
79+ if: ${{ inputs.run_previous_failed }}
80+ run: sudo ln -s ${{ steps.previous_artifacts.outputs.download-path }}/failed-tests /src/.automation.conf/tempest/load-lists/previous-failed-tests
81+
4782<% if github_kayobe_hook | length >= 1 %>
4883 %% github_kayobe_hook | indent(width=6, first=false) %%
4984<% endif %>
50- - name: Run ${{ github.event.inputs.test_suite }} tempest testsuite
85+ - name: Run ${{ inputs.run_previous_failed == false && github.event.inputs.test_suite || 'previous failed tests' }} tempest testsuite
5186 run: |
5287 /src/.automation/pipeline/tempest.sh -e ansible_user=stack
5388 env:
5691<% endif %>
5792 KAYOBE_VAULT_PASSWORD: "%% github_kayobe_arguments.KAYOBE_VAULT_PASSWORD | default(github_default_kayobe_arguments.KAYOBE_VAULT_PASSWORD) %%"
5893 KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: "%% github_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY | default(github_default_kayobe_arguments.KAYOBE_AUTOMATION_SSH_PRIVATE_KEY) %%"
59- KAYOBE_AUTOMATION_TEMPEST_LOADLIST: ' %% github_kayobe_arguments.KAYOBE_AUTOMATION_TEMPEST_LOADLIST | default(github_default_kayobe_arguments.KAYOBE_AUTOMATION_TEMPEST_LOADLIST) %%'
94+ KAYOBE_AUTOMATION_TEMPEST_LOADLIST: " %% github_kayobe_arguments.KAYOBE_AUTOMATION_TEMPEST_LOADLIST | default(github_default_kayobe_arguments.KAYOBE_AUTOMATION_TEMPEST_LOADLIST) %%"
6095 TEMPEST_PATTERN: '%% github_kayobe_arguments.TEMPEST_PATTERN | default(github_default_kayobe_arguments.TEMPEST_PATTERN) %%'
6196 TEMPEST_OPENRC: "%% github_kayobe_arguments.TEMPEST_OPENRC | default(github_default_kayobe_arguments.TEMPEST_OPENRC) %%"
6297 HOME: '%% github_kayobe_arguments.HOME | default(github_default_kayobe_arguments.HOME) %%'
@@ -79,3 +114,10 @@ jobs:
79114<% if github_final_hook | length >= 1 +%>
80115 %% github_final_hook | indent(width=6, first=false) -%%
81116<% endif %>
117+
118+ - name: Publish Test Report
119+ uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4.3.1
120+ if: success() || failure()
121+ with:
122+ report_paths: /stack/tempest-artifacts/rally-junit.xml
123+ check_name: Tempest Test Report ${{ github.run_id }} @ ${{ github.run_attempt }}
0 commit comments