From 403f8ccfec653779b297c1b852556cf7115e43e3 Mon Sep 17 00:00:00 2001 From: agaro Date: Tue, 9 Apr 2024 16:32:34 -0400 Subject: [PATCH] ci: attempt separation 2 --- .github/workflows/build-test-coverage.yml | 27 +++++++++++++++++++ .github/workflows/codecov.yml | 32 ----------------------- .github/workflows/golangci-lint.yml | 9 +++---- .github/workflows/syntax.yml | 19 ++++++++++++++ Makefile | 4 ++- 5 files changed, 53 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/build-test-coverage.yml delete mode 100644 .github/workflows/codecov.yml create mode 100644 .github/workflows/syntax.yml diff --git a/.github/workflows/build-test-coverage.yml b/.github/workflows/build-test-coverage.yml new file mode 100644 index 0000000..51d6149 --- /dev/null +++ b/.github/workflows/build-test-coverage.yml @@ -0,0 +1,27 @@ +name: CI +on: + push: + tags: + - v* + branches: + - master + pull_request: +jobs: + build: + name: build-test-coverage + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: ^1.19 + id: go + - uses: actions/checkout@v4 + - run: make build + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + file: ./coverage.txt # optional + flags: unittests # optional + fail_ci_if_error: true # optional (default = false) + verbose: true diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 36842ed..0000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: CI -on: - push: - tags: - - v* - branches: - - master - pull_request: -jobs: - build: - name: codecov - runs-on: ubuntu-latest - steps: - # - name: Set up Go 1.x - # uses: actions/setup-go@v4 - # with: - # go-version: ^1.19 - # id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - # - name: Run 'all' make target - # run: make all - - name: codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - file: ./coverage.txt # optional - flags: unittests # optional - name: codecov-umbrella # optional - fail_ci_if_error: true # optional (default = false) - verbose: true diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index eeacd0c..003d565 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: CI on: push: tags: @@ -9,16 +9,15 @@ on: permissions: contents: read jobs: - golangci: - name: lint + build: + name: golangci-lint runs-on: ubuntu-latest steps: - uses: actions/setup-go@v4 with: go-version: 1.19 - uses: actions/checkout@v4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + - uses: golangci/golangci-lint-action@v3 with: version: v1.55.2 args: --timeout 3m --verbose \ No newline at end of file diff --git a/.github/workflows/syntax.yml b/.github/workflows/syntax.yml new file mode 100644 index 0000000..7fdf862 --- /dev/null +++ b/.github/workflows/syntax.yml @@ -0,0 +1,19 @@ +name: CI +on: + push: + tags: + - v* + branches: + - master + pull_request: +jobs: + build: + name: syntax + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: ^1.19 + id: go + - uses: actions/checkout@v4 + - run: make check-syntax diff --git a/Makefile b/Makefile index c3fbed6..4e07b5c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,9 @@ BINARY := kubedog COVER_FILE := coverage.txt -all: generate check-dirty-repo build +all: check-syntax build + +check-syntax: generate check-dirty-repo generate: download go generate kubedog.go