JOJ3/.gitea/workflows/test.yaml
张泊明518370910136 ecea98e912
Some checks failed
checks / build (push) Failing after 1m53s
checks / build (pull_request) Has been cancelled
ci: test cache
2024-09-19 18:55:53 -04:00

57 lines
1.9 KiB
YAML

---
name: checks
on:
- push
- pull_request
jobs:
build:
container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
volumes:
- /home/actions/.ssh:/root/.ssh
steps:
- name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs
- name: Setup Go 1.23.1
run: |
wget -q https://studygolang.com/dl/golang/go1.23.1.linux-amd64.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz
rm -rf go1.23.1.linux-amd64.tar.gz
echo "PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV
- name: Display Go version
run: go version
- name: Get go-hashfiles
uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |-
go.mod
go.sum
- name: Echo hash
run: echo ${{ steps.hash-go.outputs.hash }}
- name: Cache go
id: cache-go
uses: https://gitea.com/actions/cache@v3 # Action cache
with: # specify with your GOMODCACHE and GOCACHE
path: |-
/root/go/pkg/mod
/root/.cache/go-build
key: go_cache-${{ steps.hash-go.outputs.hash }}
restore-keys: |-
go_cache-${{ steps.hash-go.outputs.hash }}
- name: Prepare
run: |
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
chown -R root:root /root/.ssh
- name: Build
run: make build
- name: Test
run: |
make prepare-test
make ci-test