From 97f48fbf97bc89e21a1bc811deaaedb025918c28 Mon Sep 17 00:00:00 2001 From: Jesse Michael Date: Thu, 8 Sep 2022 19:55:34 -0700 Subject: [PATCH 1/3] ci: add golang test workflow Add a starter workflow for testing golang repos --- workflow-templates/go-test.properties.json | 11 + workflow-templates/go-test.yaml | 41 ++++ workflow-templates/gopher.svg | 238 +++++++++++++++++++++ 3 files changed, 290 insertions(+) create mode 100644 workflow-templates/go-test.properties.json create mode 100644 workflow-templates/go-test.yaml create mode 100644 workflow-templates/gopher.svg diff --git a/workflow-templates/go-test.properties.json b/workflow-templates/go-test.properties.json new file mode 100644 index 0000000..813f127 --- /dev/null +++ b/workflow-templates/go-test.properties.json @@ -0,0 +1,11 @@ +{ + "name": "Go Test", + "description": "Go Test Workflow", + "iconName": "gopher", + "categories": [ + "Go" + ], + "filePatterns": [ + ".*\\.go$" + ] +} diff --git a/workflow-templates/go-test.yaml b/workflow-templates/go-test.yaml new file mode 100644 index 0000000..e409253 --- /dev/null +++ b/workflow-templates/go-test.yaml @@ -0,0 +1,41 @@ +name: Go Test +on: + pull_request: + +jobs: + go-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.19.x + - name: Go mod cache + id: go-cache + uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + vendor + key: ${{ runner.os }}-go-${{ hashFiles('**/go.*') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Go mod vendor + if: steps.go-cache.outputs.cache-hit != 'true' + env: + GOPRIVATE: "github.com/encodium" + run: | + echo "machine github.com login rp-build-user password ${{ secrets.CLONE_PAT }}" > ~/.netrc + go mod vendor + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.45.2 + skip-go-installation: true + args: --print-issued-lines=true -c ./.golangci.yml --max-same-issues 0 -v --timeout 5m + - name: Go test + run: | + go test ./... -mod=vendor -cover -coverprofile coverage.out -coverpkg ./... + GOFLAGS=-mod=vendor go tool cover -func=coverage.out diff --git a/workflow-templates/gopher.svg b/workflow-templates/gopher.svg new file mode 100644 index 0000000..e5a68fe --- /dev/null +++ b/workflow-templates/gopher.svg @@ -0,0 +1,238 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5702a84a8ef7462504dfd2bef7da04da2aae3a12 Mon Sep 17 00:00:00 2001 From: Jesse Michael Date: Thu, 8 Sep 2022 19:56:03 -0700 Subject: [PATCH 2/3] ci: add kube lint workflow add starter workflow for kubernetes lint action --- .../dev-kube-lint.properties.json | 10 ++++++++++ workflow-templates/dev-kube-lint.yaml | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 workflow-templates/dev-kube-lint.properties.json create mode 100644 workflow-templates/dev-kube-lint.yaml diff --git a/workflow-templates/dev-kube-lint.properties.json b/workflow-templates/dev-kube-lint.properties.json new file mode 100644 index 0000000..de8ed54 --- /dev/null +++ b/workflow-templates/dev-kube-lint.properties.json @@ -0,0 +1,10 @@ +{ + "name": "Kubernetes Lint", + "description": "Kubernetes Lint Workflow", + "categories": [ + "Kubernetes" + ], + "filePatterns": [ + "deployments/*" + ] +} diff --git a/workflow-templates/dev-kube-lint.yaml b/workflow-templates/dev-kube-lint.yaml new file mode 100644 index 0000000..d001e38 --- /dev/null +++ b/workflow-templates/dev-kube-lint.yaml @@ -0,0 +1,17 @@ +name: Kube Lint +on: + pull_request: + paths: + - deployments/* + +jobs: + kube-linter: + name: chart-lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Scan repo with kube-linter + uses: stackrox/kube-linter-action@v1.0.4 + with: + directory: deployments From 3cf2b52ba437aa022d99d79a930ddaee2bb44997 Mon Sep 17 00:00:00 2001 From: Jesse Michael Date: Thu, 8 Sep 2022 19:56:38 -0700 Subject: [PATCH 3/3] ci: add commit lint workflow add starter workflow for linting commit messages. --- .../dev-commit-lint.properties.json | 4 ++++ workflow-templates/dev-commit-lint.yaml | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 workflow-templates/dev-commit-lint.properties.json create mode 100644 workflow-templates/dev-commit-lint.yaml diff --git a/workflow-templates/dev-commit-lint.properties.json b/workflow-templates/dev-commit-lint.properties.json new file mode 100644 index 0000000..2dc4e7b --- /dev/null +++ b/workflow-templates/dev-commit-lint.properties.json @@ -0,0 +1,4 @@ +{ + "name": "Commit Lint", + "description": "Commit Lint Workflow" +} diff --git a/workflow-templates/dev-commit-lint.yaml b/workflow-templates/dev-commit-lint.yaml new file mode 100644 index 0000000..f5e33fb --- /dev/null +++ b/workflow-templates/dev-commit-lint.yaml @@ -0,0 +1,17 @@ +name: Commit Lint +on: + pull_request: + +jobs: + commitlint: + name: commit-lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: commitlint + uses: wagoid/commitlint-github-action@v4 + with: + configFile: "./.commitlintrc.yml"