-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (96 loc) · 2.72 KB
/
tests.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test and Lint
on:
pull_request:
branches:
- main
- beta
types:
- opened
- edited
- synchronize
- reopened
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Cache Node.js dependencies
id: cache-node-modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
cd frontend
npm install
- name: Cache build output
id: cache-dist
uses: actions/cache@v3
with:
path: frontend/dist
key: ${{ runner.os }}-dist-${{ hashFiles('**/frontend/src/**/*') }}
restore-keys: |
${{ runner.os }}-dist-
- name: Build frontend
if: steps.cache-dist.outputs.cache-hit != 'true'
run: |
cd frontend
npm run build
- name: Set Up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Run Golang Linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Up Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Cache Node.js dependencies
id: cache-node-modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
cd frontend
npm install
- name: Cache build output
id: cache-dist
uses: actions/cache@v3
with:
path: frontend/dist
key: ${{ runner.os }}-dist-${{ hashFiles('**/frontend/src/**/*') }}
restore-keys: |
${{ runner.os }}-dist-
- name: Build frontend
if: steps.cache-dist.outputs.cache-hit != 'true'
run: |
cd frontend
npm run build
- name: Set Up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Run Tests
run: go test ./... -cover