From 3db6b24962099bab4636d45e1f2bdfe66243cdc7 Mon Sep 17 00:00:00 2001 From: cubicroot Date: Sun, 4 Aug 2024 09:41:43 +0200 Subject: [PATCH] add workflow for golang code quality --- .github/workflows/golang_quality.yaml | 32 ++++++++++++++++++++++ .github/workflows/golang_quality_test.yaml | 5 ++++ tests/golang_quality/go.mod | 3 ++ tests/golang_quality/main.go | 7 +++++ 4 files changed, 47 insertions(+) create mode 100644 .github/workflows/golang_quality.yaml create mode 100644 .github/workflows/golang_quality_test.yaml create mode 100644 tests/golang_quality/go.mod create mode 100644 tests/golang_quality/main.go diff --git a/.github/workflows/golang_quality.yaml b/.github/workflows/golang_quality.yaml new file mode 100644 index 0000000..2f206c0 --- /dev/null +++ b/.github/workflows/golang_quality.yaml @@ -0,0 +1,32 @@ +on: + workflow_call: + inputs: + docker_build_args: + required: false + type: string + docker_file_path: + required: false + default: "./" + type: string + image_name: + required: true + type: string + secrets: + dockerhub_user: + required: true + dockerhub_token: + required: true + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: v1.22.5 + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 \ No newline at end of file diff --git a/.github/workflows/golang_quality_test.yaml b/.github/workflows/golang_quality_test.yaml new file mode 100644 index 0000000..208eb88 --- /dev/null +++ b/.github/workflows/golang_quality_test.yaml @@ -0,0 +1,5 @@ +on: push + +jobs: + golang_quality: + uses: ./.github/workflows/golang_quality.yaml \ No newline at end of file diff --git a/tests/golang_quality/go.mod b/tests/golang_quality/go.mod new file mode 100644 index 0000000..c14b105 --- /dev/null +++ b/tests/golang_quality/go.mod @@ -0,0 +1,3 @@ +module golang_quality + +go 1.22.1 diff --git a/tests/golang_quality/main.go b/tests/golang_quality/main.go new file mode 100644 index 0000000..ce83eea --- /dev/null +++ b/tests/golang_quality/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("I am used for testing CI workflows") +}