Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
chore(deps): update golang docker tag to v1.20 (#190)
Browse files Browse the repository at this point in the history
* chore(deps): update golang docker tag to v1.20

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Paramtamtam <[email protected]>
  • Loading branch information
renovate[bot] and tarampampam authored Feb 23, 2023
1 parent 79f8d01 commit ae28ce3
Show file tree
Hide file tree
Showing 23 changed files with 95 additions and 121 deletions.
6 changes: 3 additions & 3 deletions .github/actions/newman/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ runs:
- name: Pull newman docker image
shell: bash
run: |
if [[ "$(docker images -q postman/newman:5.2-alpine 2> /dev/null)" == "" ]]; then
docker pull postman/newman:5.2-alpine 1>/dev/null
if [[ "$(docker images -q postman/newman:5.3-alpine 2> /dev/null)" == "" ]]; then
docker pull postman/newman:5.3-alpine 1>/dev/null
fi
# Image page: <https://hub.docker.com/r/postman/newman>,
Expand All @@ -37,7 +37,7 @@ runs:
--net host \
--volume "$(pwd):/rootfs:ro" \
--workdir "/rootfs" \
postman/newman:5.2-alpine run "${{ inputs.collection }}" \
postman/newman:5.3-alpine run "${{ inputs.collection }}" \
--environment "${{ inputs.environment }}" \
--env-var "base_url=${{ inputs.baseurl }}" \
--color on
38 changes: 13 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
name: Build for ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -19,30 +19,24 @@ jobs:
- os: windows
arch: 386
steps:
- name: Set up Go
uses: actions/setup-go@v3
with: {go-version: 1.19}
- uses: actions/checkout@v3

- name: Check out code
uses: actions/checkout@v3
- uses: gacts/setup-go-with-cache@v1
with: {go-version-file: go.mod}

- uses: gacts/github-slug@v1
id: slug
- {uses: gacts/github-slug@v1, id: slug}

- name: Generate builder values
id: values
run: |
echo "::set-output name=binary-name::mikrotik-hosts-parser-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`"
- name: Install Go dependencies
run: go mod download

- name: Build application
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
LDFLAGS: -s -w -X github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version.version=${{ steps.slug.outputs.version }}
LDFLAGS: -s -w -X gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version.version=${{ steps.slug.outputs.version }}
run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/mikrotik-hosts-parser/

- name: Upload binaries to release
Expand All @@ -55,28 +49,22 @@ jobs:

docker-image:
name: Build docker image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2 # Action page: <https://github.com/docker/setup-qemu-action>
- {uses: gacts/github-slug@v1, id: slug}

- uses: gacts/github-slug@v1
id: slug
- uses: docker/setup-qemu-action@v2 # Action page: <https://github.com/docker/setup-qemu-action>

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 # Action page: <https://github.com/docker/setup-buildx-action>
- uses: docker/setup-buildx-action@v2 # Action page: <https://github.com/docker/setup-buildx-action>

- name: Login to default Container Registry
uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action>
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
55 changes: 17 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
jobs:
gitleaks:
name: Gitleaks
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0}
Expand All @@ -25,18 +25,18 @@ jobs:

golangci-lint:
name: Golang-CI (lint)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
- uses: gacts/setup-go-with-cache@v1
with: {go-version: 1.19}

- uses: golangci/golangci-lint-action@v3 # Action page: <https://github.com/golangci/golangci-lint-action>

goreportcard:
name: Update state on goreportcard.com
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' # only for `master` branch
steps:
- name: Send update request
Expand All @@ -45,23 +45,13 @@ jobs:

go-test:
name: Unit tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with: {go-version: 1.19}

- uses: actions/checkout@v3
with:
fetch-depth: 2 # Fixes codecov error 'Issue detecting commit SHA'

- name: Go modules Cache # Docs: <https://git.io/JfAKn#go---modules>
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
with: {fetch-depth: 2} # Fixes codecov error 'Issue detecting commit SHA'

- run: go mod download
- uses: gacts/setup-go-with-cache@v1
with: {go-version-file: go.mod}

- run: go test -race -covermode=atomic -coverprofile /tmp/coverage.txt ./...

Expand All @@ -74,7 +64,7 @@ jobs:

build:
name: Build for ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -87,28 +77,18 @@ jobs:
arch: 386
needs: [golangci-lint, go-test]
steps:
- uses: actions/setup-go@v3
with: {go-version: 1.19}

- uses: actions/checkout@v3

- uses: gacts/github-slug@v1
id: slug

- name: Go modules Cache # Docs: <https://git.io/JfAKn#go---modules>
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- uses: gacts/setup-go-with-cache@v1
with: {go-version-file: go.mod}

- run: go mod download
- {uses: gacts/github-slug@v1, id: slug}

- env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
LDFLAGS: -s -w -X github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version.version=${{ steps.slug.outputs.branch-name-slug }}@${{ steps.slug.outputs.commit-hash-short }}
LDFLAGS: -s -w -X gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version.version=${{ steps.slug.outputs.branch-name-slug }}@${{ steps.slug.outputs.commit-hash-short }}
run: go build -trimpath -ldflags "$LDFLAGS" -o /tmp/mikrotik-hosts-parser ./cmd/mikrotik-hosts-parser/

- name: Try to execute
Expand All @@ -125,7 +105,7 @@ jobs:

e2e:
name: End-to-End tests (cache in ${{ matrix.caching-engine }})
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -158,13 +138,12 @@ jobs:

docker-image:
name: Build docker image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [golangci-lint, go-test]
steps:
- uses: actions/checkout@v3

- uses: gacts/github-slug@v1
id: slug
- {uses: gacts/github-slug@v1, id: slug}

- name: Build image
run: |
Expand Down Expand Up @@ -194,7 +173,7 @@ jobs:

docker-image-e2e:
name: Docker image End-to-End tests (cache in ${{ matrix.caching-engine }})
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher

### Changed

- Go version updated from `1.17.2` up to `1.19`
- Go version updated from `1.17.2` up to `1.20`
- Module name changed from `github.com/tarampampam/mikrotik-hosts-parser/v4` to `gh.tarampamp.am/mikrotik-hosts-parser/v4`

## v4.4.0

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.2

# Image page: <https://hub.docker.com/_/golang>
FROM golang:1.19-alpine as builder
FROM golang:1.20-alpine as builder

# can be passed with any prefix (like `v1.2.3@GITHASH`)
# e.g.: `docker build --build-arg "APP_VERSION=v1.2.3@GITHASH" .`
Expand All @@ -19,7 +19,7 @@ WORKDIR /src
COPY . .

# arguments to pass on each go tool link invocation
ENV LDFLAGS="-s -w -X github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version.version=$APP_VERSION"
ENV LDFLAGS="-s -w -X gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version.version=$APP_VERSION"

RUN set -x \
&& go version \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>

SHELL = /bin/sh
LDFLAGS = "-s -w -X github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version.version=$(shell git rev-parse HEAD)"
LDFLAGS = "-s -w -X gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version.version=$(shell git rev-parse HEAD)"

DC_RUN_ARGS = --rm --user "$(shell id -u):$(shell id -g)"
APP_NAME = $(notdir $(CURDIR))
Expand Down
3 changes: 2 additions & 1 deletion cmd/mikrotik-hosts-parser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"path/filepath"

"github.com/fatih/color"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cli"

"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cli"
)

// exitFn is a function for application exiting.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ volumes:

services:
app: &app-service
image: golang:1.19-buster # Image page: <https://hub.docker.com/_/golang>
image: golang:1.20-buster # Image page: <https://hub.docker.com/_/golang>
working_dir: /src
environment:
HOME: /tmp
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tarampampam/mikrotik-hosts-parser/v4
module gh.tarampamp.am/mikrotik-hosts-parser/v4

go 1.19
go 1.20

require (
github.com/a8m/envsubst v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/healthcheck/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/spf13/cobra"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/env"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/env"
)

type checker interface {
Expand Down
13 changes: 7 additions & 6 deletions internal/pkg/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"context"

"github.com/spf13/cobra"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/checkers"
healthcheckCmd "github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cli/healthcheck"
serveCmd "github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cli/serve"
versionCmd "github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cli/version"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/logger"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version"

"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/checkers"
healthcheckCmd "gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cli/healthcheck"
serveCmd "gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cli/serve"
versionCmd "gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cli/version"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/logger"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version"
)

// NewCommand creates root command.
Expand Down
9 changes: 5 additions & 4 deletions internal/pkg/cli/serve/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import (

"github.com/go-redis/redis/v8"
"github.com/spf13/cobra"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/breaker"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cache"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/config"
appHttp "github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/http"
"go.uber.org/zap"

"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/breaker"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cache"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/config"
appHttp "gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/http"
)

const cachingEngineMemory, cachingEngineRedis = "memory", "redis"
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/serve/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/go-redis/redis/v8"
"github.com/spf13/pflag"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/env"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/env"
)

type flags struct {
Expand Down
5 changes: 2 additions & 3 deletions internal/pkg/http/handlers/api/settings/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"encoding/json"
"net/http"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cache"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/config"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cache"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/config"
)

type (
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/http/handlers/api/settings/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"testing"
"time"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cache"

"github.com/stretchr/testify/assert"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/config"

"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cache"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/config"
)

func TestNewHandler(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions internal/pkg/http/handlers/generate/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (

"go.uber.org/zap"

"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/cache"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/config"
"github.com/tarampampam/mikrotik-hosts-parser/v4/internal/pkg/version"
"github.com/tarampampam/mikrotik-hosts-parser/v4/pkg/hostsfile"
"github.com/tarampampam/mikrotik-hosts-parser/v4/pkg/mikrotik"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/cache"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/config"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/internal/pkg/version"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/pkg/hostsfile"
"gh.tarampamp.am/mikrotik-hosts-parser/v4/pkg/mikrotik"
)

type metrics interface {
Expand Down
Loading

0 comments on commit ae28ce3

Please sign in to comment.