-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (35 loc) · 1.13 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: ci
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup FluentCI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: pkgx
args: install go
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: go get & build
run: |
go get
go build -o ./bin/main
- name: Check code style
run: gofmt main.go | diff --ignore-tab-expansion main.go -
- name: go test
run: |
fluentci run --wasm postgres start
pkgx psql --host=localhost -d postgres -U `whoami` -c 'CREATE DATABASE s2;'
pkgx psql --host=localhost -d postgres -U `whoami` -c 'CREATE USER postgres CREATEROLE;'
pkgx psql --host=localhost -d postgres -U `whoami` -c 'GRANT ALL PRIVILEGES ON DATABASE s2 TO postgres;'
go install gotest.tools/gotestsum@latest
gotestsum --junitfile junit.xml ./...
- name: Test web server
run: |
curl --silent localhost:8001/time | grep "The current time is"