chore(ci): use golangci-lint-action (#1477)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Matthieu MOREL · committed by GitHub · parent 1beb476 · Browse files · 3 files·+101 added−90 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
Diff stats
3 files+101 added−90 removed
- other:+101 added−90 removed
Provenance
- Commit
ff2c55e- Tree
28732c3- Author
Matthieu MOREL <mmorel-35@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
1beb476
3 files changed+101 added−90 removed
added:.github/workflows/test.yml+100 added
1+name: Test2+3+on:4+ push:5+ pull_request:6+7+env:8+ GO111MODULE: on9+10+jobs:11+12+ golangci-lint:13+ runs-on: ubuntu-latest14+ steps:15+16+ - uses: actions/setup-go@v217+ with:18+ go-version: '1.17'19+20+ - uses: actions/checkout@v221+22+ - uses: golangci/golangci-lint-action@v223+ with:24+ version: latest25+ args: --verbose26+27+ test-unix:28+ strategy:29+ fail-fast: false30+ matrix:31+ platform:32+ - ubuntu33+ - macOS34+ go:35+ - 1436+ - 1537+ - 1638+ - 1739+ name: '${{ matrix.platform }} | 1.${{ matrix.go }}.x'40+ runs-on: ${{ matrix.platform }}-latest41+ steps:42+43+ - uses: actions/setup-go@v244+ with:45+ go-version: 1.${{ matrix.go }}.x46+47+ - uses: actions/checkout@v248+49+ - uses: actions/cache@v250+ with:51+ path: ~/go/pkg/mod52+ key: ${{ runner.os }}-1.${{ matrix.go }}.x-${{ hashFiles('**/go.sum') }}53+ restore-keys: ${{ runner.os }}-1.${{ matrix.go }}.x-54+55+ - run: |56+ export GOBIN=$HOME/go/bin57+ case "${{ matrix.go }}" in58+ 16|17) _version='@latest';;59+ *) _version='';;60+ esac61+ go install github.com/kyoh86/richgo"${_version}"62+ go install github.com/mitchellh/gox"${_version}"63+64+ - run: PATH=$HOME/go/bin/:$PATH make test cobra_generator65+66+ test-win:67+ name: MINGW6468+ defaults:69+ run:70+ shell: msys2 {0}71+ runs-on: windows-latest72+ steps:73+74+ - shell: bash75+ run: git config --global core.autocrlf input76+77+ - uses: msys2/setup-msys2@v278+ with:79+ msystem: MINGW6480+ update: true81+ install: >82+ git83+ make84+ unzip85+ mingw-w64-x86_64-go86+87+ - uses: actions/checkout@v288+89+ - uses: actions/cache@v290+ with:91+ path: ~/go/pkg/mod92+ key: ${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}93+ restore-keys: ${{ runner.os }}-${{ matrix.go }}-94+95+ - run: |96+ export GOBIN=$HOME/go/bin97+ go install github.com/kyoh86/richgo@latest98+ go install github.com/mitchellh/gox@latest99+100+ - run: PATH=$HOME/go/bin:$PATH make test cobra_generatordeleted:.github/workflows/Test.yml-89 removed
1-name: Test2-3-on:4- push:5- pull_request:6-7-env:8- GO111MODULE: on9-10-jobs:11-12-13- test-unix:14- strategy:15- fail-fast: false16- matrix:17- platform:18- - ubuntu19- - macOS20- go:21- - 1422- - 1523- - 1624- - 1725- name: '${{ matrix.platform }} | 1.${{ matrix.go }}.x'26- runs-on: ${{ matrix.platform }}-latest27- steps:28-29- - uses: actions/setup-go@v230- with:31- go-version: 1.${{ matrix.go }}.x32-33- - uses: actions/checkout@v234-35- - uses: actions/cache@v236- with:37- path: ~/go/pkg/mod38- key: ${{ runner.os }}-1.${{ matrix.go }}.x-${{ hashFiles('**/go.sum') }}39- restore-keys: ${{ runner.os }}-1.${{ matrix.go }}.x-40-41- - run: |42- export GOBIN=$HOME/go/bin43- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOBIN latest44- case "${{ matrix.go }}" in45- 16|17) _version='@latest';;46- *) _version='';;47- esac48- go install github.com/kyoh86/richgo"${_version}"49- go install github.com/mitchellh/gox"${_version}"50-51- - run: PATH=$HOME/go/bin/:$PATH make52-53-54- test-win:55- name: MINGW6456- defaults:57- run:58- shell: msys2 {0}59- runs-on: windows-latest60- steps:61-62- - shell: bash63- run: git config --global core.autocrlf input64-65- - uses: msys2/setup-msys2@v266- with:67- msystem: MINGW6468- update: true69- install: >70- git71- make72- unzip73- mingw-w64-x86_64-go74-75- - uses: actions/checkout@v276-77- - uses: actions/cache@v278- with:79- path: ~/go/pkg/mod80- key: ${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}81- restore-keys: ${{ runner.os }}-${{ matrix.go }}-82-83- - run: |84- export GOBIN=$HOME/go/bin85- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOBIN latest86- go install github.com/kyoh86/richgo@latest87- go install github.com/mitchellh/gox@latest88-89- - run: PATH=$HOME/go/bin:$PATH makemodified:Makefile+1 added-1 removed
21 unmodified lines22 lint:23 $(info ******************** running lint tools ********************)24 golangci-lint run -v25 26-test: install_deps lint26+test: install_deps27 $(info ******************** running tests ********************)28 richgo test -v ./...29 30 cobra_generator: install_deps10 unmodified lines