From 3b468a8b7dfaa166fcc790a8a37bada41a249e4e Mon Sep 17 00:00:00 2001 From: skanehira Date: Fri, 16 Aug 2024 10:21:11 +0900 Subject: [PATCH] chore: update ci (#67) --- .github/workflows/ci.yaml | 34 ++++++++++++---------------------- .github/workflows/release.yaml | 9 +++++++-- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d53fb5f..0d3beb1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,49 +12,39 @@ jobs: lint: strategy: matrix: - go-version: [1.x] - os: [ - # NOTE: ignore windows because it will be timeout - #windows-latest, - macos-latest, - ubuntu-latest - ] + os: [windows-latest, macos-latest, ubuntu-latest] name: golangci-lint runs-on: ${{ matrix.os }} steps: + - uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version-file: "go.mod" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.54 - - name: go vet - run: go vet ./... + version: v1.60.1 - name: go build run: go build test: strategy: matrix: - go-version: [1.x] os: [windows-latest, macos-latest, ubuntu-latest] name: test runs-on: ${{ matrix.os }} steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v4 - - uses: actions/cache@v4.0.2 + - name: Install Go + id: setup-go + uses: actions/setup-go@v5 with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version-file: "go.mod" + - name: Download Go modules + shell: bash + if: ${{ steps.setup-go.outputs.cache-hit != 'true' }} + run: go mod download - name: go test run: go test -v ./... -coverprofile=coverage.out - uses: k1LoW/octocov-action@v1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d742219..92c4a3c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,10 +14,15 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Go + - name: Install Go + id: setup-go uses: actions/setup-go@v5 with: - go-version: 1.x + go-version-file: "go.mod" + - name: Download Go modules + shell: bash + if: ${{ steps.setup-go.outputs.cache-hit != 'true' }} + run: go mod download - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 with: