Этот коммит содержится в:
Viacheslav Poturaev 2024-05-02 14:51:52 +02:00 коммит произвёл GitHub
родитель c3756d1aa2
коммит 4ade3314e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 24 добавлений и 14 удалений

3
.github/workflows/gorelease.yml предоставленный
Просмотреть файл

@ -9,13 +9,12 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
GO_VERSION: 1.19.x GO_VERSION: stable
jobs: jobs:
gorelease: gorelease:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install Go stable - name: Install Go stable
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: ${{ env.GO_VERSION }} go-version: ${{ env.GO_VERSION }}

2
.github/workflows/release-assets.yml предоставленный
Просмотреть файл

@ -15,7 +15,7 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: 1.20.x go-version: stable
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build artifacts - name: Build artifacts

8
.github/workflows/test.yml предоставленный
Просмотреть файл

@ -8,7 +8,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [ 1.16.x, 1.17.x, 1.19.x, 1.20.x, 1.21.x ] # Lowest supported and current stable versions. go-version: [ 1.16.x, 1.17.x, oldstable, stable ] # Lowest supported and current stable versions.
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install Go - name: Install Go
@ -29,10 +29,10 @@ jobs:
- name: Run gofmt - name: Run gofmt
run: gofmt -d -e . 2>&1 | tee outfile && test -z "$(cat outfile)" && rm outfile run: gofmt -d -e . 2>&1 | tee outfile && test -z "$(cat outfile)" && rm outfile
- name: Run staticcheck - name: Run staticcheck
if: matrix.go-version == '1.20.x' if: matrix.go-version == 'stable'
uses: dominikh/staticcheck-action@v1.3.1 uses: dominikh/staticcheck-action@v1.3.1
with: with:
version: "2023.1.3" version: "latest"
install-go: false install-go: false
cache-key: ${{ matrix.go }} cache-key: ${{ matrix.go }}
@ -49,7 +49,7 @@ jobs:
go install ./cmd/godog go install ./cmd/godog
godog -f progress --strict godog -f progress --strict
- name: Report on code coverage - name: Report on code coverage
if: matrix.go-version == '1.17.x' if: matrix.go-version == 'stable'
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4
with: with:
file: ./coverage.txt file: ./coverage.txt

Просмотреть файл

@ -2,21 +2,32 @@
VERS ?= $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match) VERS ?= $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
FOUND_GO_VERSION := $(shell go version) GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
EXPECTED_GO_VERSION = 1.17 GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 16
GO_VERSION_VALIDATION_ERR_MSG = Go version $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION) is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
.PHONY: check-go-version .PHONY: check-go-version
check-go-version: check-go-version:
@$(if $(findstring ${EXPECTED_GO_VERSION}, ${FOUND_GO_VERSION}),(exit 0),(echo Wrong go version! Please install ${EXPECTED_GO_VERSION}; exit 1)) @if [ $(GO_MAJOR_VERSION) -gt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
exit 0 ;\
elif [ $(GO_MAJOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
elif [ $(GO_MINOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MINOR_VERSION) ] ; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
fi
test: check-go-version test: check-go-version
@echo "running all tests" @echo "running all tests"
@go install ./...
@go fmt ./... @go fmt ./...
@go run honnef.co/go/tools/cmd/staticcheck@v0.2.2 github.com/cucumber/godog @go run honnef.co/go/tools/cmd/staticcheck@v0.4.7 github.com/cucumber/godog
@go run honnef.co/go/tools/cmd/staticcheck@v0.2.2 github.com/cucumber/godog/cmd/godog @go run honnef.co/go/tools/cmd/staticcheck@v0.4.7 github.com/cucumber/godog/cmd/godog
go vet ./... go vet ./...
go test -race ./... go test -race ./...
godog -f progress -c 4 go run ./cmd/godog -f progress -c 4
gherkin: gherkin:
@if [ -z "$(VERS)" ]; then echo "Provide gherkin version like: 'VERS=commit-hash'"; exit 1; fi @if [ -z "$(VERS)" ]; then echo "Provide gherkin version like: 'VERS=commit-hash'"; exit 1; fi