rename jobs and bump version on golang-action

This commit is contained in:
Markus Viitamäki
2020-05-06 09:31:22 +02:00
parent b7a45cfd76
commit 1b03a98d9f
+26 -13
View File
@@ -1,4 +1,4 @@
name: Go name: Review & Build
on: on:
push: push:
branches-ignore: master branches-ignore: master
@@ -11,55 +11,68 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '12.x' node-version: '12.x'
- name: npm install dependencies
run: npm install --prefix ui - name: npm install and build
- name: npm run build run: |
run: npm run --prefix ui build npm install --prefix ui
- name: bindfs npm run --prefix ui build
uses: "cedrickring/golang-action@1.4.1"
- name: Get and install bindfs
uses: "cedrickring/golang-action@1.5.2"
with: 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 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 - name: Check styling error
uses: "cedrickring/golang-action@1.4.1" uses: "cedrickring/golang-action@1.5.2"
with: with:
args: go get -u golang.org/x/lint/golint; golint -set_exit_status main.go server.go config.go args: go get -u golang.org/x/lint/golint; golint -set_exit_status main.go server.go config.go
- name: Check missing error check - name: Check missing error check
uses: "cedrickring/golang-action@1.4.1" uses: "cedrickring/golang-action@1.5.2"
with: with:
args: go get -u github.com/kisielk/errcheck; errcheck ./... args: go get -u github.com/kisielk/errcheck; errcheck ./...
- name: Check suspicious constructs (1) - name: Check suspicious constructs (1)
uses: "cedrickring/golang-action@1.4.1" uses: "cedrickring/golang-action@1.5.2"
with: 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 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) - name: Check suspicious constructs (2)
uses: "cedrickring/golang-action@1.4.1" uses: "cedrickring/golang-action@1.5.2"
with: with:
args: go vet ./... args: go vet ./...
- name: Check security issues with gosec - name: Check security issues with gosec
uses: "cedrickring/golang-action@1.4.1" uses: "cedrickring/golang-action@1.5.2"
with: with:
# TODO: remove `-exclude=G110` once https://github.com/go-bindata/go-bindata/pull/50 is merged and released # 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 args: go get github.com/securego/gosec/cmd/gosec; gosec -exclude=G110 ./... # https://github.com/securego/gosec
build: build:
name: Build code
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- name: free disk space
- name: Clean out old builds from disk
run: | run: |
sudo swapoff -a sudo swapoff -a
sudo rm -f /swapfile sudo rm -f /swapfile
sudo apt clean sudo apt clean
docker rmi $(docker image ls -aq) docker rmi $(docker image ls -aq)
df -h df -h
- name: Install buildah - name: Install buildah
run: | run: |
sudo apt-get install -qq -y software-properties-common sudo apt-get install -qq -y software-properties-common
sudo add-apt-repository -y ppa:projectatomic/ppa sudo add-apt-repository -y ppa:projectatomic/ppa
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get -qq -y install buildah sudo apt-get -qq -y install buildah
- name: Build the Docker image - name: Build the Docker image
run: buildah bud --format=docker --layers -f Dockerfile . run: buildah bud --format=docker --layers -f Dockerfile .