This repository was archived by the owner on Mar 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (58 loc) · 1.54 KB
/
simple.yaml
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
## workflow for running the build and unit tests
on:
# run this workflow on any branch or a PR
push:
branches:
- "**"
pull_request:
branches:
- "**"
name: simple
jobs:
build-test:
strategy:
# matrix lets us expand our range of OSs / go
matrix:
go-version: [1.17]
node-version: [16.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
# Skip install if testing action locally using act
if: ${{ !env.ACT }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: cache go mod
# Skip caching if testing action locally using act
if: ${{ !env.ACT }}
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
#
# Frontend
#
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
working-directory: ./ui
- run: npm run build --if-present
working-directory: ./ui
#
# Backend (requires frontend)
#
- name: Test
run: go test -failfast ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: build --snapshot