Skip to content

Commit

Permalink
chore(ci): fix test workflow (#280)
Browse files Browse the repository at this point in the history
- Set version of download-artifact and upload-artifact to v3 (need for save artifacts with same name from different jobs).
- Set ginkgo version to v2.22.0.
- Update dependencies.
- Add yaml linter.
- Update go linter.

Signed-off-by: Evgeniy Frolov <[email protected]>
  • Loading branch information
Fral738 authored Dec 11, 2024
1 parent e5e242a commit 417f6b6
Show file tree
Hide file tree
Showing 25 changed files with 186 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_cli_and_api_partials_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go 1.18
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.18
id: go
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.directory }}/go.mod

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install prettier
run: task -p deps:install:prettier

- name: Lint
run: task -p lint

- name: Install linter
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.1
- name: Lint
working-directory: ${{ matrix.directory }}
run: make lint
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.directory }}/go.mod

Expand All @@ -54,15 +54,15 @@ jobs:
echo "~/.local/bin" >> $GITHUB_PATH
# install ginkgo
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/onsi/ginkgo/v2/ginkgo@v2.22.0
shell: bash

- name: Test
working-directory: ${{ matrix.directory }}
run: ginkgo -vet=off -race -keepGoing -cover -coverpkg=./... -outputdir=$TRDL_TEST_COVERAGE_DIR ./...
run: ginkgo --vet=off --race --keep-going --cover --coverpkg=./... --output-dir=$TRDL_TEST_COVERAGE_DIR ./...

- name: Upload coverage artifact
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v3
with:
name: tests_coverage
path: tests_coverage
Expand All @@ -79,7 +79,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: e2e/go.mod

Expand Down Expand Up @@ -110,14 +110,14 @@ jobs:
make install
echo "~/.local/bin" >> $GITHUB_PATH
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/onsi/ginkgo/v2/ginkgo@v2.22.0
- name: Test
working-directory: e2e
run: ginkgo -p -keepGoing -cover -coverpkg=../client/...,../server/... -outputdir=$TRDL_TEST_COVERAGE_DIR ./...
run: ginkgo -p --keep-going --cover --coverpkg=../client/...,../server/... --output-dir=$TRDL_TEST_COVERAGE_DIR ./...

- name: Upload coverage artifact
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v3
with:
name: tests_coverage
path: tests_coverage
Expand All @@ -133,12 +133,12 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: e2e/go.mod

- name: Download coverage artifact
uses: actions/download-artifact@master
uses: actions/download-artifact@v3
with:
name: tests_coverage
path: tests_coverage
Expand Down
14 changes: 11 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ linters:
disable-all: true
enable:
# Default linters.
- deadcode
- ineffassign
- structcheck
- typecheck
- varcheck
- unused

# Extra linters.
- asciicheck
Expand All @@ -41,3 +39,13 @@ linters:
- gocritic
- gofumpt
- misspell
- nolintlint

issues:
# Show all errors.
max-issues-per-linter: 0
max-same-issues: 0

exclude:
# TODO use %w in the future.
- "non-wrapping format verb for fmt.Errorf" # errorlint
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs/.helm
docs/_data/sidebars
werf.yaml
docs/_data/breadcrumbs.yml
20 changes: 20 additions & 0 deletions Taskfile.dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,23 @@ tasks:
git signatures show {{.CLI_ARGS}} $ref
done
- git signatures push {{.CLI_ARGS}}

deps:install:prettier:
desc: "Install prettier."
cmds:
- npm install -g prettier

lint:
desc: 'Run all linters in parallel.'
deps:
- lint:prettier

lint:prettier:
desc: "Check if prettier-formatted."
deps:
- lint:prettier:yaml

lint:prettier:yaml:
desc: "Check if yaml files are prettier-formatted."
cmds:
- prettier -c "**/*.yaml" "**/*.yml"
4 changes: 2 additions & 2 deletions client/trdl.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker_image: golang:1.20.2-alpine3.17@sha256:4e6bc0eafc261b6c8ba9bd9999b6698e8cefbe21e6d90fbc10c34599d75dc608
commands:
- go install github.com/mitchellh/gox@8c3b2b9e647dc52457d6ee7b5adcf97e2bafe131
- cd client && ./scripts/ci/build_release_v2.sh {{ .Tag }} && cp -a release-build/{{ .Tag }}/* /result
- go install github.com/mitchellh/gox@8c3b2b9e647dc52457d6ee7b5adcf97e2bafe131
- cd client && ./scripts/ci/build_release_v2.sh {{ .Tag }} && cp -a release-build/{{ .Tag }}/* /result
12 changes: 6 additions & 6 deletions client/trdl_channels.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
groups:
- name: "0"
channels:
- name: alpha
version: 0.7.0
- name: stable
version: 0.7.0
- name: "0"
channels:
- name: alpha
version: 0.7.0
- name: stable
version: 0.7.0
20 changes: 10 additions & 10 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ site_description: Deliver your software continuously & securely.
github_repo_path: /werf/trdl

exclude:
- .gitignore
- Gemfile
- Gemfile.lock
- werf.yaml
- pages_ru/
- .gitignore
- Gemfile
- Gemfile.lock
- werf.yaml
- pages_ru/

highlighter: rouge

plugins:
- jekyll-assets
- jekyll-assets

markdown: kramdown
kramdown:
input: GFM
hard_wrap: false
syntax_highlighter: rouge
input: GFM
hard_wrap: false
syntax_highlighter: rouge

breadcrumbs:
root:
hide: false # show breadcrumbs on root/home page
hide: false # show breadcrumbs on root/home page
image: false # Show image or title text
hometext: "Home"

Expand Down
12 changes: 6 additions & 6 deletions docs/_config_ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ site_lang: ru
site_description: Инструмент безопасной доставки вашего кода пользователям.

exclude:
- .gitignore
- Gemfile
- Gemfile.lock
- werf.yaml
- pages_en/
- .gitignore
- Gemfile
- Gemfile.lock
- werf.yaml
- pages_en/

include:
- pages_ru/
- pages_ru/

breadcrumbs:
hometext: "Начало"
2 changes: 1 addition & 1 deletion docs/_data/trdl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ directives:
required: true
description:
en: Build instructions. The instructions can use the `{{ .Tag }}` pattern, which is replaced by a git tag
ru: Сборочные инструкции. В инструкциях можно использовать шаблон `{{ .Tag }}`, который заменяется на собираемый git-tag
ru: Сборочные инструкции. В инструкциях можно использовать шаблон `{{ .Tag }}`, который заменяется на собираемый git-tag
2 changes: 1 addition & 1 deletion docs/_data/trdl_channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ directives:
required: true
description:
en: Existing version
ru: Существующая версия
ru: Существующая версия
32 changes: 17 additions & 15 deletions e2e/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module github.com/werf/trdl/e2e

go 1.20
go 1.23

toolchain go1.23.2

require (
github.com/hashicorp/go-hclog v1.4.0
github.com/hashicorp/vault/sdk v0.8.1
github.com/onsi/ginkgo/v2 v2.9.1
github.com/onsi/gomega v1.27.4
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.34.2
github.com/prashantv/gostub v1.1.0
github.com/werf/trdl/client v0.0.0
github.com/werf/trdl/server v0.0.0
Expand Down Expand Up @@ -38,13 +40,13 @@ require (
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/gookit/color v1.5.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
Expand Down Expand Up @@ -92,16 +94,16 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/tools v0.26.0 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading

0 comments on commit 417f6b6

Please sign in to comment.