1
0
Fork 0
datetime.link/.github/workflows/build.yml

91 lines
1.7 KiB
YAML
Raw Normal View History

2020-10-31 01:12:08 +08:00
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test code
run: make test
2020-10-31 01:18:17 +08:00
vet:
name: Vet
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Vet code
run: go vet
format:
name: Format
2020-10-31 01:12:08 +08:00
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set Git user
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Format code
2020-10-31 01:22:34 +08:00
run: gofmt -l -w -s .
2020-10-31 01:12:08 +08:00
- name: Commit and push changes
id: commit-dockerfiles
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -m "[Action] go fmt" -a
git push
fi
2020-10-31 01:18:17 +08:00
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- name: Check out code into the Go module directory
uses: actions/checkout@v2
2020-10-31 01:12:08 +08:00
- name: Build
run: make TAGS=production
2020-11-08 00:57:43 +08:00
# vim: set et ts=2 sw=2: