From 48bd1a44e60e6cbd121767ac2cac46f5bf4b8f42 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:55:49 +0500 Subject: [PATCH] Configure Renovate (#116) Co-authored-by: Renovate Bot Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com> --- .editorconfig | 2 +- .github/renovate.json | 7 +++++++ .github/workflows/tests.yml | 17 ++--------------- .golangci.yml | 8 -------- docker-compose.yml | 22 +++++++--------------- internal/tpl/render.go | 2 +- 6 files changed, 18 insertions(+), 40 deletions(-) create mode 100644 .github/renovate.json diff --git a/.editorconfig b/.editorconfig index fbdc476..136701f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,7 @@ indent_style = space indent_size = 4 trim_trailing_whitespace = true -[*.{yml, yaml, sh, conf}] +[*.{yml, yaml, sh, conf, json}] indent_size = 2 [{Makefile, go.mod, *.go}] diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..bd6ba4f --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>tarampampam/.github//renovate/default", + ":rebaseStalePrs" + ] +} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a37fd7..0eff82f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,14 +25,7 @@ jobs: # Docs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: {go-version: 1.17} # On v1.18 I had an error "panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt" - - - name: Run linter - uses: golangci/golangci-lint-action@v3 # Action page: - with: - version: v1.44 # without patch version - only-new-issues: false # show only new issues if it's a pull request + - uses: golangci/golangci-lint-action@v3 # Action page: validate-config-file: name: Validate config file @@ -242,13 +235,7 @@ jobs: # Docs: - working-directory: .artifact run: docker load < docker-image.tar - - name: Download hurl - env: - VERSION: 1.5.0 - run: curl -SL -o hurl.deb https://github.com/Orange-OpenSource/hurl/releases/download/${VERSION}/hurl_${VERSION}_amd64.deb - - - name: Install hurl - run: sudo dpkg -i hurl.deb + - uses: gacts/install-hurl@v1 - name: Run container with the app run: docker run --rm -d -p "8080:8080/tcp" -e "SHOW_DETAILS=true" -e "PROXY_HTTP_HEADERS=X-Foo,Bar,Baz_blah" --name app app:ci diff --git a/.golangci.yml b/.golangci.yml index 4d15183..37073ca 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -43,8 +43,6 @@ linters: # All available linters list: - command: - - go - - run - - ./cmd/error-pages - - serve - - --verbose - - --port=8080 - - --show-details - - --proxy-headers=X-Foo,Bar,Baz_blah + command: sh -c "go build -o /tmp/app ./cmd/error-pages && /tmp/app serve" healthcheck: - test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:8080/healthz'] - interval: 5s - timeout: 2s + test: ['CMD', '/tmp/app', 'healthcheck', '--log-json'] + interval: 4s + timeout: 1s + start_period: 5s golint: - image: golangci/golangci-lint:v1.44-alpine # Image page: + image: golangci/golangci-lint:v1.46-alpine # Image page: environment: GOLANGCI_LINT_CACHE: /tmp/golint # volumes: @@ -53,5 +46,4 @@ services: - .:/src:ro working_dir: /src depends_on: - web: - condition: service_healthy + web: {condition: service_healthy} diff --git a/internal/tpl/render.go b/internal/tpl/render.go index 820186d..7694393 100644 --- a/internal/tpl/render.go +++ b/internal/tpl/render.go @@ -206,7 +206,7 @@ func (tr *TemplateRenderer) Close() error { } func (tr *TemplateRenderer) mixHashes(a, b Hash) (result cacheEntryHash) { - for i := 0; i < len(a); i++ { + for i := 0; i < len(a); i++ { //nolint:gosimple result[i] = a[i] }