From 88caaef399285cdbf64be2589f8bf53ca5aff88b Mon Sep 17 00:00:00 2001 From: DanilBaibak Date: Fri, 19 Jan 2024 14:27:31 +0100 Subject: [PATCH] Added cleanup steps --- .github/workflows/linux_job.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux_job.yml b/.github/workflows/linux_job.yml index 4a6913eda8..8af68e9f45 100644 --- a/.github/workflows/linux_job.yml +++ b/.github/workflows/linux_job.yml @@ -222,9 +222,24 @@ jobs: path: ${{ env.RUNNER_TEST_RESULTS_DIR }} fail-on-empty: false - - name: Chown repository directory - if: always() - uses: ./test-infra/.github/actions/chown-directory - with: - directory: ${{ github.workspace }}/${{ env.repository }} - ALPINE_IMAGE: ${{ inputs.runner == 'linux.arm64.2xlarge' && 'arm64v8/alpine' || '308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine' }} + - name: Check directory owner + run: | + ls -la ${{ github.workspace }}/${{ env.repository }} + + - name: Teardown Linux + if: ${{ always() }} + uses: ./test-infra/.github/actions/teardown-linux + + - name: Clean workspace after tear down + if: ${{ always() }} + env: + NO_SUDO: ${{ inputs.no-sudo }} + REPOSITORY: ${{ inputs.repository || github.repository }} + run: | + set +e + if [[ "${NO_SUDO}" == "false" ]]; then + sudo rm -rf "${GITHUB_WORKSPACE:?}/${REPOSITORY:?}" + else + rm -rf "${GITHUB_WORKSPACE:?}/${REPOSITORY:?}" + fi + set -e