From 4bd1e2e7d8c0d4a56ba7117acd967f748f57037c Mon Sep 17 00:00:00 2001 From: Nicholas Flynt Date: Fri, 24 May 2024 12:35:07 -0400 Subject: [PATCH 1/4] First stab at a GHA for build/test --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..1a594efd --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,25 @@ +name: CI + +on: + pull_request: {} + push: + branches: + - master + - release/* + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - name : Checkout repository + # https://github.com/actions/checkout/releases/tag/v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Install Go + # https://github.com/actions/setup-go/releases/tag/v5.0.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: 'go.mod' + - name: Build + run: make build-bin + - name: Test + run: make test From 9137045d724857ceeabd5b4551beb13be17ab914 Mon Sep 17 00:00:00 2001 From: Nicholas Flynt Date: Fri, 24 May 2024 12:50:53 -0400 Subject: [PATCH 2/4] Take a stab at getting golangci-lint working --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a594efd..e34a46c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,15 @@ jobs: uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version-file: 'go.mod' + - name: Install mockgen + run: go install github.com/golang/mock/mockgen@v1.6.0 + - name: Install golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.57.1 - name: Build run: make build-bin - name: Test run: make test + - name: Validate + run: make validate From f3d2a72abd8474f99af754bff2eaece113234e5a Mon Sep 17 00:00:00 2001 From: Nicholas Flynt Date: Fri, 24 May 2024 13:04:38 -0400 Subject: [PATCH 3/4] Remove drone integration Note: this also removes the FOSSA step! Be sure we create an issue to re-add this at a later date, if we decide to do that. --- .drone.yml | 59 ------------------------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index f1761624..00000000 --- a/.drone.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -kind: pipeline -name: fossa - -steps: - - name: fossa - image: rancher/drone-fossa:latest - settings: - api_key: - from_secret: FOSSA_API_KEY - when: - instance: - include: - - drone-publish.rancher.io - exclude: - - drone-pr.rancher.io ---- -kind: pipeline -name: build - -steps: - - name: build - image: registry.suse.com/bci/golang:1.22 - commands: - - make build-bin - when: - event: - - push - - pull_request ---- -kind: pipeline -name: validate - -steps: - - name: validate - image: registry.suse.com/bci/bci-base:15.6 - commands: - - zypper in -y "golang(API)=1.22" git tar gzip make - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1 - - mv ./bin/golangci-lint /usr/local/bin/golangci-lint - - GOBIN=/usr/local/bin go install github.com/golang/mock/mockgen@v1.6.0 - - make validate - when: - event: - - push - - pull_request ---- -kind: pipeline -name: test - -steps: - - name: test - image: registry.suse.com/bci/golang:1.22 - commands: - - make test - when: - event: - - push - - pull_request From 3e6d25417d78c1da991664f532aa03b61f5cf632 Mon Sep 17 00:00:00 2001 From: nflynt Date: Tue, 28 May 2024 10:13:21 -0400 Subject: [PATCH 4/4] Pin golangci by commit ID rather than version tag Co-authored-by: Tom Lebreux --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e34a46c8..2a51093e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: - name: Install mockgen run: go install github.com/golang/mock/mockgen@v1.6.0 - name: Install golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1 with: version: v1.57.1 - name: Build