update golangci-lint, go and libs #390
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: [ "**" ] | |
pull_request: | |
branches: [ "**" ] | |
workflow_dispatch: | |
env: | |
GO_VER: 1.23.4 | |
GO_VER_OLD: 1.20.3 | |
GINKGO_VER: 2.22.0 | |
jobs: | |
check-cyrillic-comments: | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: check cyrillic comments | |
run: | | |
grep --exclude-dir={.git,.github} -I -r --color -n -E "[А-Яа-яЁё]+" . && exit 1 || exit 0 | |
validate-go: | |
needs: | |
- check-cyrillic-comments | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VER }} | |
- name: check go.mod | |
run: | | |
go mod tidy | |
git diff --exit-code go.mod | |
- name: go fmt | |
run: | | |
go fmt ./... | |
git diff --exit-code | |
golangci-lint: | |
needs: | |
- validate-go | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VER }} | |
cache: false | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.62 | |
args: --out-format=colored-line-number | |
skip-cache: true | |
problem-matchers: true | |
go-test-unit: | |
needs: | |
- golangci-lint | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: | |
- '1.23.4' | |
- '1.20.3' | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: unit test | |
run: | | |
go test -count 1 ./... | |
go-test-coverage: | |
needs: | |
- golangci-lint | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VER }} | |
- name: generate test coverage | |
run: | | |
go test ./... -coverprofile=./coverage.out | |
# https://github.com/vladopajic/go-test-coverage | |
- uses: vladopajic/[email protected] | |
with: | |
config: ./.testcoverage.yml | |
profile: coverage.out | |
local-prefix: github.com/${{ github.repository }} | |
go-test-integration: | |
needs: | |
- golangci-lint | |
strategy: | |
fail-fast: false | |
matrix: | |
INTEGRATION_TEST_SUITE: [ "config","emission","basic","rights","account","lists" ] | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VER }} | |
- name: redis | |
run: docker pull redis:7.2.4 | |
- name: fabric-ccenv | |
run: docker pull hyperledger/fabric-ccenv:latest | |
- name: fabric-baseos | |
run: docker pull hyperledger/fabric-baseos:latest | |
- name: install ginkgo | |
run: go install github.com/onsi/ginkgo/v2/ginkgo@v${{ env.GINKGO_VER }} | |
- name: integration test | |
working-directory: ./tests/integration | |
run: | | |
ginkgo --keep-going --poll-progress-after 60s --timeout 24h ${{matrix.INTEGRATION_TEST_SUITE}} | |