forked from pufferpanel/pufferpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.1 KB
/
pr.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
name: PR Build
on:
pull_request:
jobs:
build:
name: Validate Builds
runs-on: ubuntu-20.04
if: startsWith(github.head_ref, 'l10n_master') == false
steps:
- name: Set up Node 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
path: pufferpanel
- name: Restore NPM cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-nodemodules-14-pr-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodemodules-14-pr
- name: Restore NPM cache
uses: actions/cache@v2
with:
path: client/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Download Go Binaries
run: |
wget https://github.com/swaggo/swag/releases/download/v1.6.7/swag_1.6.7_Linux_x86_64.tar.gz
mkdir -p ~/go/bin
tar -zxf swag*.tar.gz -C ~/go/bin
rm -rf swag*.tar.gz
- name: Prepare supporting stuff
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64
- name: Build Linux
run: |
go build -o pufferpanel -v github.com/pufferpanel/pufferpanel/v2/cmd
go test -v ./...
env:
GOOS: linux
GOARCH: amd64
- name: Build Windows
run: |
go build -o pufferpanel.exe -v github.com/pufferpanel/pufferpanel/v2/cmd
env:
GOOS: windows
GOARCH: amd64
CC: x86_64-w64-mingw32-gcc
CXX: x86_64-w64-mingw32-g++
CGO_ENABLED: 1
- name: npm install, build
run: |
npm install
npm run build
env:
CI: true
working-directory: client
- name: Generate Swagger Docs
run: |
~/go/bin/swag init -o web/swagger -g web/loader.go