From ca7017a995134ee4ce1aeee514d72c8667577016 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Wed, 13 Nov 2024 18:41:50 +0700 Subject: [PATCH] ci: fix home dir --- .github/actions/rust/action.yaml | 10 +++++++--- .github/workflows/tests-dashmate.yml | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/rust/action.yaml b/.github/actions/rust/action.yaml index 8854007013..c22923a221 100644 --- a/.github/actions/rust/action.yaml +++ b/.github/actions/rust/action.yaml @@ -95,6 +95,10 @@ runs: shell: bash run: echo "key=$(echo '${{ github.ref_name }}' | sha256sum | cut -d ' ' -f1)" >> $GITHUB_OUTPUT + - name: Set HOME variable to github context + shell: bash + run: echo "HOME=$HOME" >> $GITHUB_ENV + - name: Cache cargo registry (S3 bucket cache) uses: strophy/actions-cache@opendal-update if: inputs.cache == 'true' @@ -102,9 +106,9 @@ runs: bucket: multi-runner-cache-x1xibo9c root: actions-cache path: | - /home/ubuntu/.cargo/registry/index - /home/ubuntu/.cargo/registry/cache - /home/ubuntu/.cargo/git + ${{ env.HOME }}/.cargo/registry/index + ${{ env.HOME }}/.cargo/registry/cache + ${{ env.HOME }}/.cargo/git key: ${{ runner.os }}/cargo/registry/${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}/cargo/registry/${{ hashFiles('**/Cargo.lock') }} diff --git a/.github/workflows/tests-dashmate.yml b/.github/workflows/tests-dashmate.yml index 557c755af4..6e1b527aa0 100644 --- a/.github/workflows/tests-dashmate.yml +++ b/.github/workflows/tests-dashmate.yml @@ -84,6 +84,10 @@ jobs: run: echo "sha=$(git log -1 --format="%h" -- packages/dashmate)" >> $GITHUB_OUTPUT if: inputs.restore_local_network_data == true + - name: Set HOME variable to github context + shell: bash + run: echo "HOME=$HOME" >> $GITHUB_ENV + - name: Use test suite local network data to speed up dashmate local network tests id: local-network-data uses: strophy/actions-cache/restore@opendal-update @@ -91,7 +95,7 @@ jobs: bucket: multi-runner-cache-x1xibo9c root: local-network-data path: | - /home/ubuntu/.dashmate + ${{ env.HOME }}/.dashmate dashmate_volumes_dump key: local-network-volumes/${{ steps.dashmate-fingerprint.outputs.sha }} if: inputs.restore_local_network_data == true @@ -105,7 +109,7 @@ jobs: env: DEBUG: 1 DASHMATE_E2E_TESTS_SKIP_IMAGE_BUILD: true - DASHMATE_E2E_TESTS_LOCAL_HOMEDIR: /home/ubuntu/.dashmate + DASHMATE_E2E_TESTS_LOCAL_HOMEDIR: ${{ env.HOME }}/.dashmate if: steps.local-network-data.outputs.cache-hit == 'true' - name: Run tests without cache