Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to go 1.23. #95

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
docker_backrest_version: "v0.27"
build_platforms: "linux/amd64,linux/arm64"
steps:
- name: Set up go 1.21
uses: actions/setup-go@v3
- name: Set up go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"
id: go

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build and test
run: |
Expand All @@ -31,30 +31,32 @@ jobs:
TZ: "Etc/UTC"

- name: Run linters
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.62.2
env:
TZ: "Etc/UTC"

- name: Install goveralls
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
go install github.com/mattn/goveralls@latest

- name: Submit coverage
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/coverage.out
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
run: echo ${BUILDX_PLATFORMS}
env:
BUILDX_PLATFORMS: ${{ steps.buildx.outputs.platforms }}

- name: Run end-to-end tests
run: |
Expand Down Expand Up @@ -170,31 +172,31 @@ jobs:
needs: build
runs-on: ubuntu-latest
env:
goreleaser_version: "v1.24.0"
goreleaser_version: "v2.5.0"
steps:
- name: Set up go 1.21
uses: actions/setup-go@v3
- name: Set up go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"
id: go

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get ref
id: vars
run: |
echo ::set-output name=ref::$(echo ${GITHUB_REF} | cut -d'/' -f3)

- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.goreleaser_version }}
args: check .goreleaser.yml

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
distribution: goreleaser
Expand Down
16 changes: 7 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ run:
timeout: 5m
output:
format: colored-line-number
skip-dirs:
- vendor

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
revive:
confidence: 0.1
maligned:
suggest-new: true
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -34,12 +31,11 @@ linters-settings:

linters:
enable:
- megacheck
- staticcheck
- revive
- govet
- unconvert
- megacheck
- gas
- gosec
- gocyclo
- dupl
- misspell
Expand All @@ -49,7 +45,7 @@ linters:
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- copyloopvar
- gocritic
- nakedret
- gosimple
Expand All @@ -58,6 +54,8 @@ linters:
disable-all: true

issues:
exclude-dirs:
- vendor
exclude-rules:
- path: _test\.go
linters:
Expand Down
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
version: 2

project_name: pgbackrest_exporter

builds:
Expand Down Expand Up @@ -50,4 +52,4 @@ release:
draft: true

changelog:
skip: true
disable: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BACKREST_VERSION="2.53"
ARG DOCKER_BACKREST_VERSION="v0.27"
ARG REPO_BUILD_TAG="unknown"

FROM golang:1.21-bookworm AS builder
FROM golang:1.23-bookworm AS builder
ARG REPO_BUILD_TAG
COPY . /build
WORKDIR /build
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.artifacts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM goreleaser/goreleaser:v1.24.0 as builder
FROM goreleaser/goreleaser:v2.5.0 as builder
WORKDIR /build
COPY . /build
RUN goreleaser release --snapshot --skip-publish --clean
RUN goreleaser release --snapshot --skip=publish --clean

FROM alpine
FROM alpine:3.20
COPY --from=builder /build/dist/ /dist/
RUN mkdir -p /artifacts && \
cp /dist/*.tar.gz /artifacts/ && \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 - 2024 woblerr
Copyright (c) 2021 - 2025 woblerr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BACKREST_VERSION="2.53"
ARG DOCKER_BACKREST_VERSION="v0.27"
ARG PG_VERSION="16"

FROM golang:1.21-bookworm AS builder
FROM golang:1.23-bookworm AS builder
ARG REPO_BUILD_TAG
COPY . /build
WORKDIR /build
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/woblerr/pgbackrest_exporter

go 1.21
go 1.23

require (
github.com/alecthomas/kingpin/v2 v2.4.0
Expand Down
Loading