Skip to content

Commit

Permalink
Merge pull request #7 from Kochava/add-linter
Browse files Browse the repository at this point in the history
feat: add golangci-lint to go pr workflows
  • Loading branch information
bpjarvis-kochava authored Mar 8, 2022
2 parents 10ba525 + c5a318e commit f7b5eb7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/go_app_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ jobs:
# Lint the commits.
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}

lint:
#
# runs golangci-lint
#
runs-on: ubuntu-latest
steps:
# Checkout code to build.
- name: Checkout repo
uses: actions/checkout@v2
# Setup Go in order to vendor dependencies in a later step.
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1'
# Use auth to get access to private Git repos for Go code dependencies.
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: kochava-ci
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest

test:
#
# ensure go standards and tests pass
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/go_lib_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ jobs:
# Lint the commits.
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}

lint:
#
# runs golangci-lint
#
runs-on: ubuntu-latest
steps:
# Checkout code to build.
- name: Checkout repo
uses: actions/checkout@v2
# Setup Go in order to vendor dependencies in a later step.
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1'
# Use auth to get access to private Git repos for Go code dependencies.
- name: Configure git for private modules
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: kochava-ci
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest

test:
#
# ensure go standards and tests pass
Expand Down

0 comments on commit f7b5eb7

Please sign in to comment.