Compare commits

...

4 Commits

Author SHA1 Message Date
Mike Farah
ee60557951 Fixing bad label in github action 2021-11-10 13:21:10 +11:00
Mike Farah
2e7f3a4410 Include secure as part of build process 2021-11-10 13:17:51 +11:00
Mike Farah
66d273d0f3 Include secure as part of build process 2021-11-10 13:09:58 +11:00
Mike Farah
c223df7912 add build check to PRs 2021-11-10 13:00:22 +11:00
4 changed files with 10 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
name: Build
on: [push]
on: [push, pull_request]
jobs:
build:
@@ -24,7 +24,7 @@ jobs:
dep ensure
fi
- name: Download deps
- name: Check the build
run: |
export PATH=${PATH}:`go env GOPATH`/bin
scripts/devtools.sh

View File

@@ -81,14 +81,17 @@ vendor: tmp/dev_image_id
format: vendor
${DOCKRUN} bash ./scripts/format.sh
.PHONY: check
check: format
${DOCKRUN} bash ./scripts/check.sh
.PHONY: secure
secure:
secure: format
${DOCKRUN} bash ./scripts/secure.sh
.PHONY: check
check: secure
${DOCKRUN} bash ./scripts/check.sh
.PHONY: test
test: check
${DOCKRUN} bash ./scripts/test.sh

View File

@@ -2,4 +2,4 @@
set -ex
go get golang.org/x/tools/cmd/goimports
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.37.1
# wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.8.1
wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.9.1

View File

@@ -3,7 +3,6 @@ package test
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"reflect"
"strings"
@@ -69,24 +68,3 @@ func AssertResultWithContext(t *testing.T, expectedValue interface{}, actualValu
t.Error(": expected <", expectedValue, "> but got <", actualValue, ">")
}
}
func WriteTempYamlFile(content string) string {
tmpfile, _ := ioutil.TempFile("", "testyaml")
defer func() {
_ = tmpfile.Close()
}()
_, _ = tmpfile.Write([]byte(content))
return tmpfile.Name()
}
func ReadTempYamlFile(name string) string {
// ignore CWE-22 gosec issue - that's more targetted for http based apps that run in a public directory,
// and ensuring that it's not possible to give a path to a file outside thar directory.
content, _ := ioutil.ReadFile(name) // #nosec
return string(content)
}
func RemoveTempYamlFile(name string) {
_ = os.Remove(name)
}