Skip to content

Commit

Permalink
Merge pull request #242 from c-bata/go1.21
Browse files Browse the repository at this point in the history
Use Go 1.21
  • Loading branch information
c-bata authored Sep 7, 2023
2 parents f1f68d5 + d3ec811 commit 6e72335
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 46 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.15, 1.16]
go: [1.21]

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Running go tests
env:
Expand Down
42 changes: 20 additions & 22 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,38 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.15
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@master

- name: Running golangci-lint
env:
GO111MODULE: auto
GOPATH: /home/runner/work/
run: |
wget https://github.com/golangci/golangci-lint/releases/download/v1.20.1/golangci-lint-1.20.1-linux-amd64.tar.gz
tar -xvf ./golangci-lint-1.20.1-linux-amd64.tar.gz
GOCILINT=./golangci-lint-1.20.1-linux-amd64/golangci-lint make lint
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
id: go
with:
go-version: '1.21'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=30m --issues-exit-code=0

build:
name: Test on ${{ matrix.os }} with ${{ matrix.go }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
go: [1.15, 1.16]
go: [1.21]

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: true
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Put a dummy js file for go:embed.
run: |
Expand All @@ -60,17 +57,18 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
go: [1.16]
go: [1.21]

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: true
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Running go tests
run: make test
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0

- name: Set up Node v14
uses: actions/setup-node@v2-beta
- name: Set up Node v18
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- run: |
cd dashboard
npm install
npm run build:prd
git checkout package-lock.json # Avoid https://github.com/c-bata/goptuna/runs/2420513033
- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.16
go-version: '1.21'
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
distribution: goreleaser
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 8 additions & 8 deletions .github/workflows/typescript-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Set up Node v14
uses: actions/setup-node@v2-beta
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- run: |
cd dashboard
npm install
Expand All @@ -29,12 +29,12 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Set up Node v14
uses: actions/setup-node@v2-beta
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- run: |
cd dashboard
npm install
Expand Down
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
linters:
disable-all: true
enable:
- gocyclo
- govet
- goimports
- misspell
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fmt: $(SOURCES) ## Formatting source codes.

.PHONY: lint
lint: ## Run golint and go vet.
@$(GOCILINT) run --no-config --disable-all --enable=goimports --enable=gocyclo --enable=govet --enable=misspell --enable=golint ./...
@$(GOCILINT) run ./...

.PHONY: test
test: ## Run tests with race condition checking.
Expand Down
2 changes: 1 addition & 1 deletion dashboard/staticfiles_develop.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build develop
//go:build develop

package dashboard

Expand Down
2 changes: 1 addition & 1 deletion dashboard/staticfiles_embed.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !develop,go1.16
//go:build !develop && go1.16

package dashboard

Expand Down
2 changes: 1 addition & 1 deletion dashboard/staticfiles_statik.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !develop,!go1.16
//go:build !develop && !go1.16

package dashboard

Expand Down

0 comments on commit 6e72335

Please sign in to comment.