-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (58 loc) · 1.75 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
name: Tests
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
# Builds images for target boards.
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.20']
node: [18.x]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Setup Node.JS ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
# Cache go build cache, used to speedup go test
# https://markphelps.me/posts/speed-up-your-go-builds-with-actions-cache/
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Build Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
# Cache go mod cache, used to speedup builds
- name: Go Mod Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Test Go
run: make test
- name: Yarn install
run: yarn install
- name: Build Javascript
run: yarn run build
- name: Test Js
run: yarn test:js
- name: Lint Javascript
run: yarn run lint:js
- name: Lint Go
run: yarn run lint:go
- name: Depcheck JS
run: yarn run deps