JOJ3/.gitea/workflows/test.yaml
张泊明518370910136 0a4045761c
All checks were successful
checks / build (push) Successful in 1m14s
checks / build (pull_request) Successful in 1m13s
ci: test cache
2024-09-19 18:49:30 -04:00

51 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: Setup Go Cache
id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Build Cache
uses: https://gitea.com/actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
uses: https://gitea.com/actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- 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