-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (55 loc) · 1.51 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache path
id: yarn-cache-path
run: echo "::set-output name=path::$(yarn cache dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-path.outputs.path }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Not recommended to cache node_modules
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---npm
- run: yarn install --frozen-lockfile
- run: yarn build
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 'stable'
# `mage format` would reformat files
- name: gofmt check
run: test -z "$(gofmt -l pkg)"
#- uses: magefile/mage-action@v2
# with:
# args: lint
- uses: golangci/golangci-lint-action@v3
with:
version: 'latest'
working-directory: pkg
- uses: magefile/mage-action@v2
with:
args: test
- uses: magefile/mage-action@v2
with:
args: buildall