From 79eb822326ea9d35a1e47ecdf3346c8e5cf56441 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:13:44 -0700 Subject: [PATCH 01/11] Change `go get` to `go install` in bootstrap ... - avoid the `-dev` tag --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a8907b8b..ce043b25 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ci: lintcgo testcgo build bootstra%: # Using a released version of golangci-lint to take into account custom replacements in their go.mod - $Q GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 + $Q GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 .PHONY: bootstra% From 72217c972d199a71f406d4fe8a603a951c2cdb39 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:21:45 -0700 Subject: [PATCH 02/11] GO111MODULE should not be necessary in bootstrap --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce043b25..79a31eba 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ci: lintcgo testcgo build bootstra%: # Using a released version of golangci-lint to take into account custom replacements in their go.mod - $Q GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 + $Q go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 .PHONY: bootstra% From 42a470d8032a056dd506178029d7a185ef7dcf3d Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:31:33 -0700 Subject: [PATCH 03/11] Move golangci-lint to github action | update bootstrap - Update bootstrap to use official golangci-lint install --- .github/workflows/release.yml | 26 +++++++++++++++++++++++++- Makefile | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f547d61d..46b72c9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,10 +25,34 @@ jobs: name: Install Deps id: install-deps run: sudo apt-get -y install libpcsclite-dev + - + name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: 'latest' + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the action will use pre-installed Go. + # skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true - name: Lint, Test, Build id: lint_test_build - run: V=1 make -j1 bootstrap ci + run: V=1 make ci create_release: name: Create Release diff --git a/Makefile b/Makefile index 79a31eba..396d0a5f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ OUTPUT_ROOT=output/ all: lint test build -ci: lintcgo testcgo build +ci: testcgo build .PHONY: all ci @@ -28,7 +28,7 @@ ci: lintcgo testcgo build bootstra%: # Using a released version of golangci-lint to take into account custom replacements in their go.mod - $Q go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 + $Q curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0 .PHONY: bootstra% From 819d4667905aa1adde22db032d585aa410ffd4b8 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:38:36 -0700 Subject: [PATCH 04/11] [actions] update test action as well --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 43 +++++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46b72c9b..bcdd188a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. # skip-build-cache: true - - name: Lint, Test, Build + name: Test, Build id: lint_test_build run: V=1 make ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74e435fd..a1e3a3f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,19 +13,48 @@ jobs: name: Lint, Test, Build runs-on: ubuntu-latest steps: - - name: Checkout + - + name: Checkout uses: actions/checkout@v2 - - name: Setup Go + - + name: Setup Go uses: actions/setup-go@v2 with: go-version: '1.15.6' - - name: Install Deps + - + name: Install Deps id: install-deps run: sudo apt-get -y install libpcsclite-dev - - name: Lint, Test, Build - id: lintTestBuild - run: V=1 make -j1 bootstrap ci - - name: Codecov + - + name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: 'latest' + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the action will use pre-installed Go. + # skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true + - + name: Test, Build + id: lint_test_build + run: V=1 make ci + - + name: Codecov uses: codecov/codecov-action@v1.2.1 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos From fa9bceefa28b331db13a3f57105e94398ac47047 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:42:54 -0700 Subject: [PATCH 05/11] [action] but golangci-lint timeout --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcdd188a..eb171a4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: # working-directory: somedir # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 + args: --timeout=30m # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1e3a3f8..23f43b0e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: # working-directory: somedir # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 + args: --timeout=30m # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true From c71d56e4ae0843a12484dc6aed5ab3d9832849fa Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:47:26 -0700 Subject: [PATCH 06/11] [action] use go version matrix for the test / build step --- .github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23f43b0e..68349653 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,10 @@ on: jobs: lintTestBuild: name: Lint, Test, Build - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.15', '1.16' ] steps: - name: Checkout @@ -20,7 +23,7 @@ jobs: name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15.6' + go-version: ${{ matrix.go }} - name: Install Deps id: install-deps From f02d97e62182dc6d293833028f1ee33bae929675 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 15:53:49 -0700 Subject: [PATCH 07/11] [action] use matrix strategy in release.test | bump to 1.16 --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb171a4b..819a470e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,9 @@ jobs: test: name: Lint, Test, Build runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.15', '1.16' ] outputs: is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} steps: @@ -20,7 +23,7 @@ jobs: name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15.8' + go-version: ${{ matrix.go }} - name: Install Deps id: install-deps @@ -120,7 +123,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.15.8' + go-version: '1.16' - name: APT Install id: aptInstall @@ -150,7 +153,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.15.8' + go-version: '1.16' - name: Build id: build run: | From ee4d45cf7969a6c5c1583b51d79d88dc1bc14c4e Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 16:02:46 -0700 Subject: [PATCH 08/11] [action] remove make bootstrap from debian build process --- debian/rules | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/rules b/debian/rules index 6683ef21..0beb3a6c 100755 --- a/debian/rules +++ b/debian/rules @@ -4,7 +4,6 @@ override_dh_install-arch: dh_install --arch build: - make bootstrap dh build %: From 39f6a27515065341d2f45588b912391488ba3cb6 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 16:30:13 -0700 Subject: [PATCH 09/11] [action] alternate makefile target for dh_auto_build --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index 0beb3a6c..db8307fa 100755 --- a/debian/rules +++ b/debian/rules @@ -6,5 +6,8 @@ override_dh_install-arch: build: dh build +override_dh_auto_build: + dh_auto build ci + %: dh $@ From 6a6be848749b491e72cb25c4ff71583d39525566 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 16:37:00 -0700 Subject: [PATCH 10/11] [action] debian rules syntax --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index db8307fa..e3c3ec9c 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ build: dh build override_dh_auto_build: - dh_auto build ci + dh_auto_build ci %: dh $@ From 335435decfd395879f6f087f1a919ec371d5f1fb Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 13 Apr 2021 16:53:30 -0700 Subject: [PATCH 11/11] [action] debian rules syntax --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index e3c3ec9c..f5b70196 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ build: dh build override_dh_auto_build: - dh_auto_build ci + dh_auto_build -- build %: dh $@