-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aed32d1
commit 0ff0ff0
Showing
1 changed file
with
0 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1 @@ | ||
version: v1.0 | ||
name: Go project example | ||
agent: | ||
machine: | ||
type: e1-standard-2 | ||
os_image: ubuntu1804 | ||
|
||
blocks: | ||
- name: Build project | ||
task: | ||
jobs: | ||
- name: Get Go packages | ||
commands: | ||
- checkout | ||
- sem-version go 1.12 | ||
- go get github.com/lib/pq | ||
- go build webServer.go | ||
- mkdir bin | ||
- mv webServer bin | ||
- cache store $(checksum webServer.go) bin | ||
|
||
- name: Check code style | ||
task: | ||
jobs: | ||
- name: gofmt | ||
commands: | ||
- checkout | ||
- sem-version go 1.12 | ||
- yes | sudo apt install gccgo-go | ||
- gofmt webServer.go | diff --ignore-tab-expansion webServer.go - | ||
|
||
- name: Smoke tests | ||
task: | ||
jobs: | ||
- name: go test | ||
commands: | ||
- checkout | ||
- sem-version go 1.12 | ||
- sem-service start postgres | ||
- psql -p 5432 -h localhost -U postgres -c "CREATE DATABASE s2" | ||
- go get github.com/lib/pq | ||
- go test ./... -v | ||
|
||
- name: Test Web Server | ||
commands: | ||
- checkout | ||
- sem-version go 1.12 | ||
- cache restore $(checksum webServer.go) | ||
- ./bin/webServer 8001 & | ||
- curl --silent localhost:8001/time | grep "The current time is" |