-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (38 loc) · 1.1 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
36
37
38
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
go install gotest.tools/gotestsum@latest
PATH=$HOME/go/bin:$PATH gotestsum --junitfile junit.xml ./...
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NIX_CONFIG: "extra-access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}"
POSTGRES_USER: postgres
POSTGRES_DATABASE: s2
- name: Test web server
run: |
./bin/main 8001 &
curl --silent localhost:8001/time | grep "The current time is"