Skip to content

Commit 59907cc

Browse files
Add github workflows
1 parent 91e9e4c commit 59907cc

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

.github/workflows/tests.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: tests
2+
on:
3+
push:
4+
pull_request:
5+
branches:
6+
- master
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Set up Go 1.18
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: 1.18
17+
- name: Run tests
18+
run: make test
19+
20+
lint-go:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
- name: golangci-lint
26+
uses: golangci/golangci-lint-action@v2
27+
with:
28+
version: latest
29+
args: --config .golangci.yml
30+
31+
lint-front:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
- name: Set up Node 16
37+
uses: actions/setup-node@v2
38+
with:
39+
node-version: "16"
40+
- name: Install dependencies
41+
working-directory: front
42+
run: yarn install
43+
- name: Run linters
44+
uses: wearerequired/lint-action@v2
45+
with:
46+
eslint: true
47+
prettier: true
48+
eslint_dir: front/src
49+
prettier_dir: front/src
50+
- name: Check the frontend compiles
51+
working-directory: front
52+
run: yarn build
53+
54+
lint-proto:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v2
59+
- name: Setup buf
60+
uses: bufbuild/[email protected]
61+
- name: Lint proto
62+
run: make lint-proto

Makefile

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ lint-proto:
66
lint-go:
77
golangci-lint run -v -c .golangci.yml ./...
88

9+
.PHONY: lint-front
10+
lint-front:
11+
cd front && yarn lint
12+
913
.PHONY: proto
1014
proto: lint-proto
1115
cd proto && buf generate
@@ -15,4 +19,11 @@ tidy:
1519
go mod tidy -compat="1.18"
1620

1721
.PHONY: lint
18-
lint: lint-proto lint-go
22+
lint: lint-proto lint-front lint-go
23+
24+
.PHONY: test-go
25+
test-go:
26+
go test -race ./...
27+
28+
.PHONY: test
29+
test: test-go

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.18
55
require (
66
github.com/improbable-eng/grpc-web v0.15.0
77
github.com/sirupsen/logrus v1.9.0
8+
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
89
google.golang.org/grpc v1.48.0
910
google.golang.org/protobuf v1.28.0
1011
)
@@ -15,7 +16,6 @@ require (
1516
github.com/golang/protobuf v1.5.2 // indirect
1617
github.com/klauspost/compress v1.11.7 // indirect
1718
github.com/rs/cors v1.7.0 // indirect
18-
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
1919
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
2020
golang.org/x/text v0.3.6 // indirect
2121
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 // indirect

0 commit comments

Comments
 (0)