Преглед изворни кода

Merge pull request #7 from skx/fix/ci

Fix the broken CI process
Steve Kemp пре 10 месеци
родитељ
комит
7823d68ae2
3 измењених фајлова са 37 додато и 3 уклоњено
  1. 4 0
      .github/build
  2. 31 3
      .github/run-tests.sh
  3. 2 0
      .github/workflows/release.yml

+ 4 - 0
.github/build

@@ -3,6 +3,10 @@
 # The basename of our binary
 BASE="rss2hook"
 
+
+# I don't even ..
+go env -w GOFLAGS="-buildvcs=false"
+
 #
 # We build on only a single platform/arch.
 #

+ 31 - 3
.github/run-tests.sh

@@ -1,8 +1,36 @@
 #!/bin/sh
 
-# Install the lint-tool, and the shadow-tool
-go get -u golang.org/x/lint/golint
-go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
+
+# I don't even ..
+go env -w GOFLAGS="-buildvcs=false"
+
+
+# Install the tools we use to test our code-quality.
+#
+# Here we setup the tools to install only if the "CI" environmental variable
+# is not empty.  This is because locally I have them installed.
+#
+# NOTE: Github Actions always set CI=true
+#
+if [ ! -z "${CI}" ] ; then
+    go install golang.org/x/lint/golint@latest
+    go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
+    go install honnef.co/go/tools/cmd/staticcheck@latest
+fi
+
+
+# Run the static-check tool - we ignore errors in goserver/static.go
+t=$(mktemp)
+staticcheck -checks all ./...  | grep -v "is deprecated"> $t
+if [ -s $t ]; then
+    echo "Found errors via 'staticcheck'"
+    cat $t
+    rm $t
+    exit 1
+fi
+rm $t
+
+
 
 # At this point failures cause aborts
 set -e

+ 2 - 0
.github/workflows/release.yml

@@ -6,6 +6,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
     - uses: actions/checkout@master
+    - name: Generate the artifacts
+      uses: skx/github-action-build@master
     - name: Upload
       uses: skx/github-action-publish-binaries@master
       env: