mirror of
https://github.com/Threnklyn/wg-ui.git
synced 2026-05-18 12:53:30 +02:00
4f57eac902
* Use Go embed.FS instead of external tool to embed assets * remove go-bindata from dockerfiles and bump ci to golang 1.16.x * remove more go-bindata related stuff Co-authored-by: Markus Viitamäki <markus.viitamaki@embark-studios.com>
78 lines
1.9 KiB
YAML
78 lines
1.9 KiB
YAML
name: PR
|
|
on:
|
|
push:
|
|
branches-ignore: main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
review:
|
|
name: Code Review
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12
|
|
|
|
- name: npm install and build
|
|
run: |
|
|
npm install --prefix ui
|
|
npm run --prefix ui build
|
|
|
|
- name: Check styling error
|
|
uses: "cedrickring/golang-action@1.7.0"
|
|
with:
|
|
args: go get -u golang.org/x/lint/golint; golint -set_exit_status main.go server.go config.go
|
|
|
|
- name: Check missing error check
|
|
uses: "cedrickring/golang-action@1.7.0"
|
|
with:
|
|
args: go get -u github.com/kisielk/errcheck; errcheck ./...
|
|
|
|
- name: Check suspicious constructs (1)
|
|
uses: "cedrickring/golang-action@1.7.0"
|
|
with:
|
|
args: go get -u honnef.co/go/tools/cmd/staticcheck; staticcheck -checks all,-ST1003,-U1000,-ST1005,-SA9002 ./... # have to disable ST1003,U1000,ST1005 due to the generated code
|
|
|
|
- name: Check suspicious constructs (2)
|
|
uses: "cedrickring/golang-action@1.7.0"
|
|
with:
|
|
args: go vet ./...
|
|
|
|
- name: Check security issues with gosec
|
|
uses: "cedrickring/golang-action@1.7.0"
|
|
with:
|
|
args: go get -u github.com/securego/gosec/cmd/gosec; gosec ./... # https://github.com/securego/gosec
|
|
|
|
build:
|
|
name: Build wg-ui
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup NodeJS
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-verison: 12
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build binary
|
|
run: |
|
|
export PATH=$PATH:$(go env GOPATH)/bin
|
|
make build
|
|
|
|
- name: Check binary
|
|
run: file bin/wireguard-ui
|
|
|
|
- name: Cleanup
|
|
run: rm -rf bin/
|