From a28ebf0a4884c5fea5aded2ba2d29d3e58218dfb Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 14 Mar 2024 10:30:05 +0000 Subject: [PATCH] Improve workflows (#98) Starting from setup-go v4, it will cache build dependencies by default, see https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs. Also bump some versions. Reviewed-on: https://gitea.com/gitea/act/pulls/98 --- .gitea/workflows/test.yml | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 6973ddc..7d35457 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -3,42 +3,19 @@ on: - push - pull_request -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - jobs: lint: name: check and test runs-on: ubuntu-latest steps: - - name: cache go path - id: cache-go-path - uses: https://github.com/actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - path: /go_path - key: go_path-${{ github.repository }}-${{ github.ref_name }} - restore-keys: | - go_path-${{ github.repository }}- - go_path- - - name: cache go cache - id: cache-go-cache - uses: https://github.com/actions/cache@v3 - with: - path: /go_cache - key: go_cache-${{ github.repository }}-${{ github.ref_name }} - restore-keys: | - go_cache-${{ github.repository }}- - go_cache- - - uses: actions/setup-go@v3 - with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: vet checks run: go vet -v ./... - name: build run: go build -v ./... - name: test - run: go test -v ./pkg/jobparser - # TODO test more packages + run: | # Test only the new packages in this fork. Add more packages as needed. + go test -v ./pkg/jobparser