mirror of
https://github.com/Threnklyn/wg-ui.git
synced 2026-05-18 21:03:30 +02:00
9d93f4092c
* Include building ui into docker file * Specify docker.io for image * removing old dist files * update gitignore to skip dist folders * adding build to arguments as the files are no longer in repo * remove bindfs to figure out the problem later * running all instead of just specified * removed bindfs action * disabling error check for now until we move building ui assets to action * added npm install & run to pull_request yaml * build ui folder * --prefix on install deps * --prefix on install deps * re-added not checking generated files Co-authored-by: Fredrik Grönqvist <fredrik.gronqvist@embark-studios.com>
66 lines
2.3 KiB
YAML
66 lines
2.3 KiB
YAML
name: Go
|
|
on:
|
|
push:
|
|
branches-ignore: master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
review:
|
|
name: Review code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12.x'
|
|
- name: npm install dependencies
|
|
run: npm install --prefix ui
|
|
- name: npm run build
|
|
run: npm run --prefix ui build
|
|
- name: bindfs
|
|
uses: "cedrickring/golang-action@1.4.1"
|
|
with:
|
|
args: go get -u github.com/go-bindata/go-bindata/... && go get -u github.com/elazarl/go-bindata-assetfs/... && go-bindata-assetfs -prefix ui/dist ui/dist
|
|
- name: Check styling error
|
|
uses: "cedrickring/golang-action@1.4.1"
|
|
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.4.1"
|
|
with:
|
|
args: go get -u github.com/kisielk/errcheck; errcheck ./...
|
|
- name: Check suspicious constructs (1)
|
|
uses: "cedrickring/golang-action@1.4.1"
|
|
with:
|
|
args: go get honnef.co/go/tools/cmd/staticcheck; staticcheck -checks all,-ST1003,-U1000,-ST1005 ./... # have to disable ST1003,U1000,ST1005 due to the generated code
|
|
- name: Check suspicious constructs (2)
|
|
uses: "cedrickring/golang-action@1.4.1"
|
|
with:
|
|
args: go vet ./...
|
|
- name: Check security issues with gosec
|
|
uses: "cedrickring/golang-action@1.4.1"
|
|
with:
|
|
# TODO: remove `-exclude=G110` once https://github.com/go-bindata/go-bindata/pull/50 is merged and released
|
|
args: go get github.com/securego/gosec/cmd/gosec; gosec -exclude=G110 ./... # https://github.com/securego/gosec
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: free disk space
|
|
run: |
|
|
sudo swapoff -a
|
|
sudo rm -f /swapfile
|
|
sudo apt clean
|
|
docker rmi $(docker image ls -aq)
|
|
df -h
|
|
- name: Install buildah
|
|
run: |
|
|
sudo apt-get install -qq -y software-properties-common
|
|
sudo add-apt-repository -y ppa:projectatomic/ppa
|
|
sudo apt-get update -qq
|
|
sudo apt-get -qq -y install buildah
|
|
- name: Build the Docker image
|
|
run: buildah bud --format=docker --layers -f Dockerfile .
|