Merge pull request #536 from smallstep/max/dev

Move golangci-lint to github action and fix debian build action
This commit is contained in:
Max 2021-04-14 13:14:34 -07:00 committed by GitHub
commit 938cd092b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 78 additions and 17 deletions

View file

@ -10,6 +10,9 @@ jobs:
test: test:
name: Lint, Test, Build name: Lint, Test, Build
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.15', '1.16' ]
outputs: outputs:
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
steps: steps:
@ -20,15 +23,39 @@ jobs:
name: Setup Go name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.15.8' go-version: ${{ matrix.go }}
- -
name: Install Deps name: Install Deps
id: install-deps id: install-deps
run: sudo apt-get -y install libpcsclite-dev run: sudo apt-get -y install libpcsclite-dev
- -
name: Lint, Test, Build 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: --timeout=30m
# 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 id: lint_test_build
run: V=1 make -j1 bootstrap ci run: V=1 make ci
create_release: create_release:
name: Create Release name: Create Release
@ -96,7 +123,7 @@ jobs:
name: Set up Go name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.15.8' go-version: '1.16'
- -
name: APT Install name: APT Install
id: aptInstall id: aptInstall
@ -126,7 +153,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.15.8' go-version: '1.16'
- name: Build - name: Build
id: build id: build
run: | run: |

View file

@ -11,21 +11,53 @@ on:
jobs: jobs:
lintTestBuild: lintTestBuild:
name: Lint, Test, Build name: Lint, Test, Build
runs-on: ubuntu-latest runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.15', '1.16' ]
steps: steps:
- name: Checkout -
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go -
name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.15.6' go-version: ${{ matrix.go }}
- name: Install Deps -
name: Install Deps
id: install-deps id: install-deps
run: sudo apt-get -y install libpcsclite-dev run: sudo apt-get -y install libpcsclite-dev
- name: Lint, Test, Build -
id: lintTestBuild name: golangci-lint
run: V=1 make -j1 bootstrap ci uses: golangci/golangci-lint-action@v2
- name: Codecov 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: --timeout=30m
# 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 uses: codecov/codecov-action@v1.2.1
with: with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

View file

@ -18,7 +18,7 @@ OUTPUT_ROOT=output/
all: lint test build all: lint test build
ci: lintcgo testcgo build ci: testcgo build
.PHONY: all ci .PHONY: all ci
@ -28,7 +28,7 @@ ci: lintcgo testcgo build
bootstra%: bootstra%:
# Using a released version of golangci-lint to take into account custom replacements in their go.mod # 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 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0
.PHONY: bootstra% .PHONY: bootstra%

4
debian/rules vendored
View file

@ -4,8 +4,10 @@ override_dh_install-arch:
dh_install --arch dh_install --arch
build: build:
make bootstrap
dh build dh build
override_dh_auto_build:
dh_auto_build -- build
%: %:
dh $@ dh $@