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
This commit is contained in:
Jason Song
2024-03-14 10:30:05 +00:00
parent 2b860ce371
commit a28ebf0a48

View File

@@ -3,42 +3,19 @@ on:
- push - push
- pull_request - pull_request
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
jobs: jobs:
lint: lint:
name: check and test name: check and test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: cache go path - uses: actions/checkout@v4
id: cache-go-path - uses: actions/setup-go@v5
uses: https://github.com/actions/cache@v3
with: with:
path: /go_path go-version-file: 'go.mod'
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
- name: vet checks - name: vet checks
run: go vet -v ./... run: go vet -v ./...
- name: build - name: build
run: go build -v ./... run: go build -v ./...
- name: test - name: test
run: go test -v ./pkg/jobparser run: | # Test only the new packages in this fork. Add more packages as needed.
# TODO test more packages go test -v ./pkg/jobparser