1
0
Fork 0

Add Action

pull/1/head
Ambrose Chua 2020-10-31 01:12:08 +08:00
parent 35d8a5094d
commit 86c710c4fe
2 changed files with 50 additions and 1 deletions

45
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
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
- name: Set Git user
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Format code
run: go fmt
- 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
- name: Build
run: make
- name: Test
run: make test

View File

@ -17,7 +17,11 @@ clean:
build: datetime
datetime: *.go
$(GO) build -o datetime
$(GO) build -v -o datetime
.PHONY: test
test:
$(GO) test -v
DATASETS = \