chore: Update Go version to 1.25.x and upgrade setup-go action to v5;… #916
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GoAnime CI | ||
| on: | ||
| push: | ||
| branches: [main, dev, ipc] | ||
| pull_request: | ||
| branches: [main, dev, ipc] | ||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macOS-latest] | ||
| go-version: ['1.25.x'] | ||
| steps: | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
| check-latest: true | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Go Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go- | ||
| - name: Install dependencies (Linux) | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y mpv | ||
| - name: Install dependencies (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| choco install mpv -y | ||
| # golangci-lint will be installed via official GitHub Action | ||
| - name: Install dependencies (macOS) | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| brew install mpv | ||
| - name: Get dependencies | ||
| run: go get -v -t -d ./... | ||
| - name: Run golangci-lint | ||
| uses: golangci/golangci-lint-action@v6 | ||
| with: | ||
| version: v1.61.0 | ||
| install-mode: go | ||
| args: --timeout=5m ./... | ||
| - name: Run tests | ||
| run: go test -v -coverprofile="coverage.out" ./... | ||
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v4.0.1 | ||
| if: ${{ secrets.CODECOV_TOKEN != '' }} | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| file: coverage.out | ||