From ac50ed254b2e246d41051ff9da8c032017dd4f1e Mon Sep 17 00:00:00 2001 From: Justin Harringa Date: Sat, 4 Mar 2023 19:06:03 -0800 Subject: [PATCH 1/2] Change to Go 1.20 / local build in container --- .github/workflows/ci.yaml | 2 +- .github/workflows/golangci-lint.yaml | 2 +- .github/workflows/release.yml | 2 +- .gitignore | 1 + Makefile | 5 +++-- go.mod | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 36fb673..a62a7d2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: '1.20' - name: Cache Go modules uses: actions/cache@v3 with: diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index aa72ff5..01c4205 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-go@v3 with: - go-version: '1.17' + go-version: '1.20' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 928a694..4f253f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: '1.20' - name: Cache Go modules uses: actions/cache@v3 with: diff --git a/.gitignore b/.gitignore index 063ec93..45ea440 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ # Build / CI artifacts /ci-result-to-slack coverage.out +/dist diff --git a/Makefile b/Makefile index 013b606..f37196a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ORG_AND_REPO=salesforce/ci-results-to-slack MOUNT_DIR=/go/src/github.com/${ORG_AND_REPO} -BUILD_CONTAINER=golang:1.17-bullseye +BUILD_CONTAINER=golang:1.20-bullseye BINARY_NAME=ci-result-to-slack ci: build test @@ -23,11 +23,12 @@ lint: clean: @echo "Cleaning..." - rm -rf .$(BINARY_NAME) + rm -rf $(BINARY_NAME) rm -rf coverage.out local-docker-test: ## Build and run unit tests in docker container like CI without building the container docker run --rm=true -v `pwd`:$(MOUNT_DIR) $(BUILD_CONTAINER) bash -c 'cd $(MOUNT_DIR) && make ci' local-docker-build: ## Build the container image + docker run --rm=true -v `pwd`:$(MOUNT_DIR) $(BUILD_CONTAINER) bash -c 'cd $(MOUNT_DIR) && make build' docker build --no-cache -t $(ORG_AND_REPO) . diff --git a/go.mod b/go.mod index 36e4531..fbbf3b6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/salesforce/ci-result-to-slack -go 1.17 +go 1.20 require ( github.com/kelseyhightower/envconfig v1.4.0 From f2fca9f0e5edf8ed46e387875dc52f383672bb72 Mon Sep 17 00:00:00 2001 From: Justin Harringa Date: Sat, 4 Mar 2023 19:08:22 -0800 Subject: [PATCH 2/2] Update golangci-lint --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 01c4205..5b11c6e 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -16,4 +16,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.29 + version: v1.51.2