diff --git a/.github/workflows/go-examples.yml b/.github/workflows/go-examples.yml index 3c62207..e4352cf 100644 --- a/.github/workflows/go-examples.yml +++ b/.github/workflows/go-examples.yml @@ -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: diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 8dfb961..f9e8570 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -10,23 +10,18 @@ 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 build: name: Test on ${{ matrix.os }} with ${{ matrix.go }} @@ -34,17 +29,18 @@ 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 }} + 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: | @@ -60,17 +56,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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15f48db..808f497 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,19 +3,21 @@ 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 @@ -23,13 +25,15 @@ jobs: 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 }} diff --git a/.github/workflows/typescript-checks.yml b/.github/workflows/typescript-checks.yml index 6796dc1..db1d5e7 100644 --- a/.github/workflows/typescript-checks.yml +++ b/.github/workflows/typescript-checks.yml @@ -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 @@ -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 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..dd9cfc8 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,7 @@ +linters: + disable-all: true + enable: + - gocyclo + - govet + - goimports + - misspell diff --git a/Makefile b/Makefile index 116c289..a653d88 100644 --- a/Makefile +++ b/Makefile @@ -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. diff --git a/dashboard/staticfiles_develop.go b/dashboard/staticfiles_develop.go index 9ae7a06..d8e2c43 100644 --- a/dashboard/staticfiles_develop.go +++ b/dashboard/staticfiles_develop.go @@ -1,4 +1,4 @@ -// +build develop +//go:build develop package dashboard diff --git a/dashboard/staticfiles_embed.go b/dashboard/staticfiles_embed.go index 99c76e6..18ed2d7 100644 --- a/dashboard/staticfiles_embed.go +++ b/dashboard/staticfiles_embed.go @@ -1,4 +1,4 @@ -// +build !develop,go1.16 +//go:build !develop && go1.16 package dashboard diff --git a/dashboard/staticfiles_statik.go b/dashboard/staticfiles_statik.go index 927860d..2710d61 100644 --- a/dashboard/staticfiles_statik.go +++ b/dashboard/staticfiles_statik.go @@ -1,4 +1,4 @@ -// +build !develop,!go1.16 +//go:build !develop && !go1.16 package dashboard