From eba42abc99de931f0eafc9f576bb6bc2d10f11e8 Mon Sep 17 00:00:00 2001 From: Lingjie Li Date: Sun, 4 Feb 2024 13:25:45 +0800 Subject: [PATCH] build: tidy & add cleanup for actions --- .github/workflows/static.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 60a2eecc..b188ba0f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -8,12 +8,13 @@ on: pull_request: env: + DEEPLINK_PATH: /mnt/cache/share/deeplinkci/github/${{ github.repository }} ENV_SOURCE: /mnt/cache/share/platform/env/dipu_latest PROXY_SOURCE: /mnt/cache/share/platform/env/proxy - WORKSPACE: /mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }} - CODE_SOURCE: source - CLANGD_TIDY_SOURCE: clangd-tidy CLANGD_EXEC: /mnt/cache/share/platform/dep/clang-17/bin/clangd + WORKSPACE: /mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }} + CODE_SOURCE: /mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }}/source + CLANGD_TIDY_SOURCE: /mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }}/clangd-tidy concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -24,6 +25,13 @@ jobs: name: checkout code runs-on: tps-sco-ci steps: + - name: clean obsolete workspaces + run: | + set -euxo pipefail + ls -la ${DEEPLINK_PATH} + rm -rf ${WORKSPACE} + find ${DEEPLINK_PATH} -maxdepth 1 -mmin +60 -type d -exec echo clean {} \&\& echo {} ok \; + false - name: prepare workspace run: | set -euxo pipefail