-
Notifications
You must be signed in to change notification settings - Fork 11
91 lines (76 loc) · 2.03 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Continuous Integration
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.21", "1.20"]
node: [21, 20]
exclude:
- go: 1.21
node: 20
- go: 1.20
node: 21
name: Go ${{ matrix.go }}, Node ${{ matrix.node }} build
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
cache-dependency-path: "web/yarn.lock"
- name: Build frontend
working-directory: ./web
run: |
yarn install --frozen-lockfile
yarn build
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install dependencies
run: sudo apt-get install -y libpcap-dev
- name: Build
run: go build -v ./cmd/pkappa2/main.go
golangci:
name: Lint Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Install dependencies
run: sudo apt-get install -y libpcap-dev
- name: Fake frontend build
run: |
mkdir -p web/dist
touch web/dist/index.html
- name: Lint
uses: golangci/golangci-lint-action@v3
yarnlint:
name: Lint Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: "yarn"
cache-dependency-path: "web/yarn.lock"
- name: Install frontend dependencies
working-directory: ./web
run: yarn install --frozen-lockfile
- name: Lint frontend
working-directory: ./web
run: |
yarn lint
yarn prettier --check .