Update gitea actions testing
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
testing / check and test (push) Successful in 18m22s

This commit is contained in:
2024-04-13 01:47:53 +00:00
parent a0e8c69f34
commit d05fa2e90a
+67 -12
View File
@@ -1,17 +1,72 @@
name: 'Test Go Action' name: testing
on: [push] on:
- push
- pull_request
env:
GOPATH: /go_path
GOCACHE: /go_cache
jobs: jobs:
use-go-action: lint:
name: check and test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Setup Go - uses: actions/checkout@v4
uses: actions/setup-go@v3
with: with:
go-version: '1.20' fetch-depth: 0 # all history for all branches and tags
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
go.mod
go.sum
- name: cache go
id: cache-go
uses: actions/cache@v4
with:
path: |
/go_path
/go_cache
key: go_path-${{ steps.hash-go.outputs.hash }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2
args: --timeout 5m
testing:
name: check and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
- name: Use Go Action - name: Setup go
id: "test" uses: actions/setup-go@v5
run: "go test ./..." with:
go-version-file: go.mod
- name: Print Output check-latest: true
run: echo 'output time is ${{ steps.test.outputs.time }}' - uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
go.mod
go.sum
- name: cache go
id: cache-go
uses: actions/cache@v4
with:
path: |
/go_path
/go_cache
key: go_path-${{ steps.hash-go.outputs.hash }}
- name: build
run: go build ./...
- name: test
run: go test ./...