123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- name: Go
- on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
- # 如果 go 项目在 server 子目录
- paths:
- - './server/**'
- jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
- steps:
- - name: Set up Go 1.13
- uses: actions/setup-go@v1
- with:
- go-version: 1.13
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v2
- - name: cache
- id: cache
- uses: actions/cache@v1
- with:
- path: ~/go/pkg/mod
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- restore-keys: |
- ${{ runner.os }}-go-
- - name: Get dependencies
- run: |
- go get -v -t -d ./...
- if [ -f Gopkg.toml ]; then
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
- fi
- working-directory: ./server
- - name: Build
- run: go build -v . -o output
- working-directory: ./server
- - name: artifact
- uses: actions/upload-artifact@v1
- with:
- name: artifact
- path: output
|