dev/actions feature: overtime #27
@@ -3,20 +3,33 @@ run-name: ${{ gitea.actor }} is testing golang Code
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
testing:
|
||||||
runs-on: docker
|
name: check and test
|
||||||
container:
|
runs-on: ubuntu-latest
|
||||||
image: golang:1.22
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout
|
||||||
uses: https://gitea.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # all history for all branches and tags
|
||||||
|
|
||||||
- name: Go dependencies
|
- name: Setup go
|
||||||
shell: sh
|
uses: actions/setup-go@v5
|
||||||
run: |
|
with:
|
||||||
go mod tidy
|
go-version-file: Backend/go.mod
|
||||||
|
check-latest: true
|
||||||
- name: Run tests
|
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
|
||||||
shell: sh
|
id: hash-go
|
||||||
run: |
|
with:
|
||||||
go test ./... -v
|
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: test
|
||||||
|
run: make test
|
||||||
|
|||||||
Reference in New Issue
Block a user