Skip to content

Commit

Permalink
Merge pull request #604 from mackerelio/go121
Browse files Browse the repository at this point in the history
update Go version to 1.21 and 1.20 by using reusable workflow
  • Loading branch information
lufia authored Nov 7, 2023
2 parents 5d3ac17 + e1c3fb6 commit 5c7c001
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 51 deletions.
13 changes: 11 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@ updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
interval: weekly
time: "01:00"
timezone: Asia/Tokyo
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
interval: weekly
time: "01:00"
timezone: Asia/Tokyo
groups:
dev-dependencies:
patterns:
- "github.com/Songmu/goxz"
- "github.com/stretchr/testify"
stable-packages:
patterns:
- "golang.org/x/*"
- "github.com/mackerelio/*"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
Expand Down
52 changes: 5 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,9 @@ env:
DEBIAN_FRONTEND: noninteractive
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v3
uses: mackerelio/workflows/.github/workflows/[email protected]
test:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v4
with:
go-version: 1.19.x
- run: |
go test -race -covermode atomic -coverprofile=profile.cov ./...
shell: bash
- uses: shogo82148/actions-goveralls@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-profile: profile.cov
parallel: true
flag-name: Go-${{ matrix.os }}
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
uses: mackerelio/workflows/.github/workflows/[email protected]
build:
needs: [lint, test]
runs-on: ubuntu-latest
Expand All @@ -62,16 +25,11 @@ jobs:
rpm devscripts debhelper fakeroot \
crossbuild-essential-arm64 crossbuild-essential-armhf
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/checkout@v4
go-version: 1.21.x
cache: true
- run: make all
- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS builder
FROM golang:1.21-alpine AS builder
RUN apk add --no-cache make git
WORKDIR /go/src/github.com/mackerelio/mkr/
COPY . .
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/mackerelio/mkr

go 1.18
go 1.20

require (
github.com/Songmu/goxz v0.9.1
Expand Down

0 comments on commit 5c7c001

Please sign in to comment.