FinnTew commented on code in PR #884: URL: https://github.com/apache/incubator-seata-go/pull/884#discussion_r2356077713
########## .github/workflows/unit-test.yml: ########## @@ -0,0 +1,78 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: "Unit Test" + +on: + push: + branches: [ master ] + pull_request: + branches: [ "*" ] + types: [opened, synchronize, reopened] + +permissions: + contents: read + +jobs: + unit-test: + name: Unit Test + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + golang: + - 1.18 + + steps: + - name: "Set up Go" + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.golang }} + + - name: "Checkout code" + uses: actions/checkout@v3 + with: + submodules: true + + - name: "Cache dependencies" + uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: "${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}" + restore-keys: | + "${{ runner.os }}-go-" + + - name: Shutdown default mysql + run: sudo service mysql stop + + + - name: "Run Unit Tests" + run: | + echo "=== Starting Unit Tests ===" + go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m + if [ $? -ne 0 ]; then + echo "❌ Unit tests failed" + exit 1 + fi + echo "✅ Unit tests completed successfully" + + - name: "Archive test results" + uses: actions/upload-artifact@v3 Review Comment: In v4, Artifacts are immutable (unless deleted). So you must change each of the uploaded Artifacts to have a different name and filter the downloads by name to achieve the same effect: ```yaml jobs: upload: strategy: matrix: runs-on: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.runs-on }} steps: - name: Create a File run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt - name: Upload Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: my-artifact + name: my-artifact-${{ matrix.runs-on }} path: file-${{ matrix.runs-on }}.txt ``` --- Refer to the corresponding GitHub actions document (as above), the CI step related to `upload-artifact` needs to be modified, including version upgrades and some parameter changes. Reference document: [https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md](https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org