-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: move deps and lint jobs only on pull requests
This war provoked as the new use of golangci-lint action fails on master with all the lint errors there. But in reality it's probably not needed to run those tasks on master - they are mostly about new code
- Loading branch information
Showing
2 changed files
with
54 additions
and
42 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 |
---|---|---|
|
@@ -21,48 +21,6 @@ env: | |
GHCR_IMAGE_ID: ${{ github.repository }} | ||
|
||
jobs: | ||
deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Check dependencies | ||
run: | | ||
go version | ||
test -z "$(go mod tidy && go mod vendor && git status --porcelain)" | ||
go mod verify | ||
- name: Check code generation | ||
run: | | ||
go install github.com/alvaroloes/[email protected] | ||
go install github.com/mailru/easyjson/[email protected] | ||
test -z "$(go generate ./... && git status --porcelain)" | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Retrieve golangci-lint version | ||
run: | | ||
echo "::set-output name=Version::$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')" | ||
id: version | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: ${{ steps.version.outputs.Version }} | ||
only-new-issues: true | ||
|
||
test-prev: | ||
strategy: | ||
fail-fast: false | ||
|
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,54 @@ | ||
name: Lint | ||
on: | ||
# Enable manually triggering this workflow via the API or web UI | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Check dependencies | ||
run: | | ||
go version | ||
test -z "$(go mod tidy && go mod vendor && git status --porcelain)" | ||
go mod verify | ||
- name: Check code generation | ||
run: | | ||
go install github.com/alvaroloes/[email protected] | ||
go install github.com/mailru/easyjson/[email protected] | ||
test -z "$(go generate ./... && git status --porcelain)" | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Retrieve golangci-lint version | ||
run: | | ||
echo "::set-output name=Version::$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')" | ||
id: version | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: ${{ steps.version.outputs.Version }} | ||
only-new-issues: true |