Skip to content

Instantly share code, notes, and snippets.

@kai5263499
Created January 26, 2022 14:36
Show Gist options
  • Save kai5263499/496a9a11070921c9bb0161aed70fef6f to your computer and use it in GitHub Desktop.
Save kai5263499/496a9a11070921c9bb0161aed70fef6f to your computer and use it in GitHub Desktop.
go test and lint github action
name: build lint and test
on: push
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup go
uses: actions/setup-go@v2
- name: configure private github access
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/PrivateRepo".insteadOf "https://github.com/PrivateRepo"
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
test:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: setup go
uses: actions/setup-go@v2
- name: configure private github access
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/PrivateRepo".insteadOf "https://github.com/PrivateRepo"
- name: test
run: |
go test -v -cover ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment