diff --git a/.github/actions/setup-linux/action.yml b/.github/actions/setup-linux/action.yml index d5d029c39a..97411fd491 100644 --- a/.github/actions/setup-linux/action.yml +++ b/.github/actions/setup-linux/action.yml @@ -53,7 +53,11 @@ runs: run: | RUNNER_ARTIFACT_DIR="${RUNNER_TEMP}/artifacts" mkdir -p "${RUNNER_ARTIFACT_DIR}" - echo "RUNNER_ARTIFACT_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" + echo "RUNNER_ARTIFACT_DIR=${RUNNER_ARTIFACT_DIR}" >> "${GITHUB_ENV}" + + RUNNER_TEST_RESULTS_DIR="${RUNNER_TEMP}/test-results" + mkdir -p "${RUNNER_TEST_RESULTS_DIR}" + echo "RUNNER_TEST_RESULTS_DIR=${RUNNER_TEST_RESULTS_DIR}" >> "${GITHUB_ENV}" - name: Needs nvidia driver? shell: bash diff --git a/.github/actions/setup-windows/action.yml b/.github/actions/setup-windows/action.yml index 212b583b46..e8932cfe49 100644 --- a/.github/actions/setup-windows/action.yml +++ b/.github/actions/setup-windows/action.yml @@ -43,4 +43,8 @@ runs: run: | RUNNER_ARTIFACT_DIR="$(cygpath ${RUNNER_TEMP})/artifacts" mkdir -p "${RUNNER_ARTIFACT_DIR}" - echo "RUNNER_ARTIFACT_DIR=$(cygpath ${RUNNER_TEMP})/artifacts" >> "${GITHUB_ENV}" + echo "RUNNER_ARTIFACT_DIR=${RUNNER_ARTIFACT_DIR}" >> "${GITHUB_ENV}" + + RUNNER_TEST_RESULTS_DIR="${RUNNER_TEMP}/test-results" + mkdir -p "${RUNNER_TEST_RESULTS_DIR}" + echo "RUNNER_TEST_RESULTS_DIR=${RUNNER_TEST_RESULTS_DIR}" >> "${GITHUB_ENV}" diff --git a/.github/workflows/linux_job.yml b/.github/workflows/linux_job.yml index 1b44b81976..a1bc7433a4 100644 --- a/.github/workflows/linux_job.yml +++ b/.github/workflows/linux_job.yml @@ -155,6 +155,7 @@ jobs: # shellcheck disable=SC2086,SC2090 container_name=$(docker run \ -e RUNNER_ARTIFACT_DIR=/artifacts \ + -e RUNNER_TEST_RESULTS_DIR=/test-results \ --env-file="${RUNNER_TEMP}/github_env_${GITHUB_RUN_ID}" \ `# It is unknown why the container sees a different value for this.` \ --env=GITHUB_STEP_SUMMARY \ @@ -169,6 +170,7 @@ jobs: -v "${GITHUB_WORKSPACE}/${REPOSITORY}:/work" \ -v "${GITHUB_WORKSPACE}/test-infra:/test-infra" \ -v "${RUNNER_ARTIFACT_DIR}:/artifacts" \ + -v "${RUNNER_TEST_RESULTS_DIR}:/test-results" \ -v "${RUNNER_TEMP}/exec_script:/exec" \ -v "${GITHUB_STEP_SUMMARY}":"${GITHUB_STEP_SUMMARY}" \ -w /work \ @@ -176,6 +178,13 @@ jobs: ) docker exec -t "${container_name}" bash /exec + - name: Surface failing tests + if: always() + uses: pmeier/pytest-results-action@v0.3.0 + with: + path: ${{ env.RUNNER_TEST_RESULTS_DIR }} + fail-on-empty: false + - name: Chown repository directory if: ${{ always() }} uses: ./test-infra/.github/actions/chown-directory diff --git a/.github/workflows/macos_job.yml b/.github/workflows/macos_job.yml index dc09a4691d..76dfcec3b0 100644 --- a/.github/workflows/macos_job.yml +++ b/.github/workflows/macos_job.yml @@ -98,7 +98,11 @@ jobs: run: | RUNNER_ARTIFACT_DIR="${RUNNER_TEMP}/artifacts" mkdir -p "${RUNNER_ARTIFACT_DIR}" - echo "RUNNER_ARTIFACT_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" + echo "RUNNER_ARTIFACT_DIR=${RUNNER_ARTIFACT_DIR}" >> "${GITHUB_ENV}" + + RUNNER_TEST_RESULTS_DIR="${RUNNER_TEMP}/test-results" + mkdir -p "${RUNNER_TEST_RESULTS_DIR}" + echo "RUNNER_TEST_RESULTS_DIR=${RUNNER_TEST_RESULTS_DIR}" >> "${GITHUB_ENV}" - name: Download artifacts (if any) uses: actions/download-artifact@v3 @@ -131,6 +135,13 @@ jobs: done < "${RUNNER_TEMP}/github_env_${GITHUB_RUN_ID}" bash "${RUNNER_TEMP}/exec_script" + - name: Surface failing tests + if: always() + uses: pmeier/pytest-results-action@v0.3.0 + with: + path: ${{ env.RUNNER_TEST_RESULTS_DIR }} + fail-on-empty: false + - name: Check if there are potential artifacts and move them to the correct artifact location shell: bash -l {0} working-directory: ${{ inputs.repository }} diff --git a/.github/workflows/windows_job.yml b/.github/workflows/windows_job.yml index f5798ea655..b4ef8a70d6 100644 --- a/.github/workflows/windows_job.yml +++ b/.github/workflows/windows_job.yml @@ -133,6 +133,13 @@ jobs: done < "${RUNNER_TEMP}/github_env_${GITHUB_RUN_ID}" bash "${RUNNER_TEMP}/exec_script" + - name: Surface failing tests + if: always() + uses: pmeier/pytest-results-action@v0.3.0 + with: + path: ${{ env.RUNNER_TEST_RESULTS_DIR }} + fail-on-empty: false + - name: Check if there are potential artifacts and move them to the correct artifact location shell: bash -l {0} working-directory: ${{ inputs.repository }}