From 6a27f858524ef965a6aa6688253f2e7b0a81504b Mon Sep 17 00:00:00 2001 From: husharp Date: Tue, 16 Apr 2024 13:20:03 +0800 Subject: [PATCH] fix cache Signed-off-by: husharp --- .github/workflows/check.yaml | 14 ++----------- .github/workflows/pd-docker-image.yaml | 4 ++-- .github/workflows/pd-tests.yaml | 22 +++++++-------------- .github/workflows/tso-consistency-test.yaml | 4 ++-- .github/workflows/tso-function-test.yaml | 4 ++-- 5 files changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 83c6fdc6098..0affd864e33 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -8,21 +8,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/setup-go@v5 - with: - go-version: '1.21' - name: Checkout code uses: actions/checkout@v4 - - name: Restore cache - uses: actions/cache@v4 + - uses: actions/setup-go@v5 with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - **/.dashboard_download_cache - key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golang + go-version: '1.21' - name: Make Check run: | SWAGGER=1 make build diff --git a/.github/workflows/pd-docker-image.yaml b/.github/workflows/pd-docker-image.yaml index 2463ffa2641..5beaa66c156 100644 --- a/.github/workflows/pd-docker-image.yaml +++ b/.github/workflows/pd-docker-image.yaml @@ -15,10 +15,10 @@ jobs: strategy: fail-fast: true steps: + - name: Checkout code + uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.21' - - name: Checkout code - uses: actions/checkout@v4 - name: Make run: make docker-image diff --git a/.github/workflows/pd-tests.yaml b/.github/workflows/pd-tests.yaml index 01f0258d265..38db9b35acc 100644 --- a/.github/workflows/pd-tests.yaml +++ b/.github/workflows/pd-tests.yaml @@ -27,20 +27,11 @@ jobs: outputs: job-total: 13 steps: - - uses: actions/setup-go@v5 - with: - go-version: '1.21' - name: Checkout code uses: actions/checkout@v4 - - name: Restore cache - uses: actions/cache@v4 + - uses: actions/setup-go@v5 with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - **/.tools - **/.dashboard_download_cache - key: ${{ runner.os }}-go-${{ matrix.worker_id }}-${{ hashFiles('**/go.sum') }} + go-version: '1.21' - name: Make Test env: WORKER_ID: ${{ matrix.worker_id }} @@ -51,9 +42,9 @@ jobs: mv covprofile covprofile_$WORKER_ID sed -i "/failpoint_binding/d" covprofile_$WORKER_ID - name: Upload coverage result ${{ matrix.worker_id }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: cover-reports + name: cover-reports-${{ matrix.worker_id }} path: covprofile_${{ matrix.worker_id }} report-coverage: needs: chunks @@ -62,9 +53,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Download chunk report - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - name: cover-reports + pattern: cover-reports-* + merge-multiple: true - name: Merge env: TOTAL_JOBS: ${{needs.chunks.outputs.job-total}} diff --git a/.github/workflows/tso-consistency-test.yaml b/.github/workflows/tso-consistency-test.yaml index b3c99c0458f..3cb24898a10 100644 --- a/.github/workflows/tso-consistency-test.yaml +++ b/.github/workflows/tso-consistency-test.yaml @@ -8,10 +8,10 @@ jobs: tso-consistency-test: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.21' - - name: Checkout code - uses: actions/checkout@v4 - name: Make TSO Consistency Test run: make test-tso-consistency diff --git a/.github/workflows/tso-function-test.yaml b/.github/workflows/tso-function-test.yaml index 8fb335bfd3d..2eaeac7f36c 100644 --- a/.github/workflows/tso-function-test.yaml +++ b/.github/workflows/tso-function-test.yaml @@ -19,10 +19,10 @@ jobs: tso-function-test: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.21' - - name: Checkout code - uses: actions/checkout@v4 - name: Make TSO Function Test run: make test-tso-function