-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Disable gomnd and execinquery (deprecated) * Add GOPROXY * Split workflows * Replace for loop with range * Disable enterprise runners * Remove Windows support
- Loading branch information
Showing
5 changed files
with
112 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,95 @@ | ||
# Original: https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
|
||
jobs: | ||
deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Check go mod | ||
run: | | ||
make deps | ||
git diff --exit-code go.mod | ||
git diff --exit-code go.sum | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Run build | ||
run: make build | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Build | ||
run: make build | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Run tests | ||
run: make test | ||
|
||
- name: Test | ||
run: make test | ||
# All of these tasks require paid GitHub plan | ||
# tests-on-windows: | ||
# runs-on: windows-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Install Go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: ${{ env.GO_VERSION }} | ||
# - name: Run build | ||
# run: make.exe build | ||
# - name: Run tests | ||
# run: make.exe test | ||
# | ||
# tests-on-macos: | ||
# runs-on: macos-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Install Go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: ${{ env.GO_VERSION }} | ||
# - name: Run tests | ||
# run: make test | ||
# | ||
# tests-on-unix: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# golang: | ||
# - '1.21' | ||
# - '1.22' | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Install Go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: ${{ matrix.golang }} | ||
# - uses: actions/cache@v4 | ||
# with: | ||
# path: ~/go/pkg/mod | ||
# key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-go-${{ matrix.golang }}- | ||
# - name: Run tests | ||
# run: make test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Original: https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: lint | ||
uses: golangci/golangci-lint-action@v5.3.0 | ||
with: | ||
version: latest |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
linters: | ||
enable-all: true | ||
disable: | ||
- gomnd | ||
- execinquery | ||
- ifshort | ||
- nosnakecase | ||
- scopelint | ||
|
This file contains 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
This file contains 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