From 7e67ce0ec9c319ce2a6b0975d45b9d4b08c4bfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 23 Jan 2024 18:57:17 +0100 Subject: [PATCH 1/3] chore: add tests workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/tests.yaml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..091d331 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,49 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + +name: Tests + +permissions: {} + +on: + pull_request: + branches: + - main + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Create test cluster + run: | + set -e + make kind-cluster + - name: Run tests + run: | + set -e + make tests + - name: Upload Report to Codecov + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + with: + file: ./coverage.out + fail_ci_if_error: true + verbose: true + + required: + needs: + - unit-tests + runs-on: ubuntu-latest + steps: + - run: echo "Required jobs success!" \ No newline at end of file From df9b56a9bc98ffd8bb9ac37eee51a50bc0f0eb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 23 Jan 2024 19:03:36 +0100 Subject: [PATCH 2/3] permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/tests.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 091d331..b4ae091 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,7 +2,7 @@ name: Tests -permissions: {} +# permissions: {} on: pull_request: @@ -26,10 +26,10 @@ jobs: with: go-version-file: go.mod cache-dependency-path: go.sum - - name: Create test cluster - run: | - set -e - make kind-cluster + # - name: Create test cluster + # run: | + # set -e + # make kind-cluster - name: Run tests run: | set -e From c41c47e3c2802ae7194af1832a999a77e7696498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 23 Jan 2024 19:05:16 +0100 Subject: [PATCH 3/3] add lint file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .golangci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..ada5dfc --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,48 @@ +linters: + enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - containedctx + - decorder + - dogsled + - durationcheck + - errcheck + - errname + - exportloopref + - gci + - gochecknoinits + - gofmt + - gofumpt + - goimports + - goprintffuncname + - gosec + - gosimple + - govet + - grouper + - importas + - ineffassign + - makezero + - misspell + - noctx + - nolintlint + - nosprintfhostport + # - paralleltest + - staticcheck + - tenv + - thelper + - tparallel + - typecheck + - unconvert + - unused + - wastedassign + - whitespace + +run: + timeout: 15m + skip-files: + - ".+\\.generated.go" + output: + format: colored-line-number + sort-results: true \ No newline at end of file