diff --git a/.github/workflows/gitee-sync.yml b/.github/workflows/gitee-sync.yml index 47e08d20..5a156681 100644 --- a/.github/workflows/gitee-sync.yml +++ b/.github/workflows/gitee-sync.yml @@ -11,17 +11,17 @@ jobs: name: Run runs-on: ubuntu-latest steps: - - name: Checkout source code - uses: actions/checkout@v1 - - name: Mirror Github to Gitee - uses: Yikun/hub-mirror-action@v1.2 - with: - src: github/go-kratos - dst: gitee/go-kratos - dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} - dst_token: ${{ secrets.GITEE_TOKEN }} - account_type: org - timeout: 600 - debug: true - force_update: true - static_list: "kratos-layout" \ No newline at end of file + - name: Checkout source code + uses: actions/checkout@v4 + - name: Mirror Github to Gitee + uses: Yikun/hub-mirror-action@v1.3 + with: + src: github/go-kratos + dst: gitee/go-kratos + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + account_type: org + timeout: 600 + debug: true + force_update: true + static_list: "kratos-layout" \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7b45a761..e09d0861 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,24 +2,37 @@ name: Go on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: - build: name: Build runs-on: ubuntu-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - name: Set up Go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v5.0.0 with: - go-version: ^1.13 + go-version: ^1.19 - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + - name: Setup Environment + run: | + echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + - name: Module cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go - name: Get dependencies run: | @@ -33,4 +46,4 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v ./... \ No newline at end of file