From 527c13abe2aadcc6b0cdc0b043d4d87065788d54 Mon Sep 17 00:00:00 2001 From: husharp Date: Fri, 13 Sep 2024 16:42:46 +0800 Subject: [PATCH] upgrade action Signed-off-by: husharp --- .github/workflows/check.yaml | 17 ++------ .github/workflows/label.yaml | 2 +- .github/workflows/pd-tests.yaml | 46 ++++----------------- .github/workflows/tso-consistency-test.yaml | 6 +-- .github/workflows/tso-function-test.yaml | 7 ++-- 5 files changed, 19 insertions(+), 59 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index cfc113cfbd44..bc2ea54fde0e 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -4,22 +4,11 @@ jobs: statics: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.16 - name: Checkout code - uses: actions/checkout@v2 - - name: Restore cache - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - **/.tools - **/.dashboard_download_cache - key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golang + go-version: 1.16 - name: Make Check run: | make build diff --git a/.github/workflows/label.yaml b/.github/workflows/label.yaml index 5ff2b895528e..00438d26b63f 100644 --- a/.github/workflows/label.yaml +++ b/.github/workflows/label.yaml @@ -7,7 +7,7 @@ jobs: add_labels: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v4 + - uses: actions/github-script@v7 name: Add labels with: script: | diff --git a/.github/workflows/pd-tests.yaml b/.github/workflows/pd-tests.yaml index c29a68ec11a2..4188592aab91 100644 --- a/.github/workflows/pd-tests.yaml +++ b/.github/workflows/pd-tests.yaml @@ -20,40 +20,11 @@ jobs: outputs: job-total: ${{ strategy.job-total }} steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.16 - name: Checkout code - uses: actions/checkout@v2 - - name: Restore cache - uses: actions/cache@v2 + uses: actions/checkout@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') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.worker_id }} - ${{ runner.os }}-go- - - name: Dispatch Packages - id: packages-units - env: - WORKER_ID: ${{ matrix.worker_id }} - # github.com/tikv/pd/tests/server/tso is the integration test of TSO, which will take a long time, - # will be run independently in the TSO Function Test. - run: | - go list ./... | grep -v -E "github.com/tikv/pd/server/api|github.com/tikv/pd/tests/client|github.com/tikv/pd/tests/server/tso" > packages.list - total=$(expr ${{ strategy.job-total }} - 1) - echo "Dispatched ${total} normal chunks" - split packages.list -n r/${total} packages_unit_ -a 1 --numeric-suffixes=1 - echo "Dispatched 2 special task to the last chunk (the special tests take a long time)" - echo github.com/tikv/pd/server/api > packages_unit_${{ strategy.job-total }} - echo github.com/tikv/pd/tests/client >> packages_unit_${{ strategy.job-total }} - packages="{$(cat packages_unit_${WORKER_ID} |tr "\n" ",")}" - echo "This worker will test the chunk - ${packages}" - echo "::set-output name=list::${packages}" + go-version: 1.16 - name: Make Test env: WORKER_ID: ${{ matrix.worker_id }} @@ -62,20 +33,21 @@ 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 runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + 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 a3e1de811df3..9b55282db270 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: - - uses: actions/setup-go@v2 + - name: Checkout code + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: 1.16 - - name: Checkout code - uses: actions/checkout@v2 - 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 fd8c14f88f66..17e5ace8e5d0 100644 --- a/.github/workflows/tso-function-test.yaml +++ b/.github/workflows/tso-function-test.yaml @@ -12,10 +12,9 @@ jobs: tso-function-test: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.16 - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: - name: Make TSO Function Test run: make test-tso-function