-
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.
Showing
1 changed file
with
54 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Main update check | ||
run-name: "PR #${{ github.event.number }} check (${{ github.sha }})" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
static-checks: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
- name: Check License Header | ||
uses: apache/skywalking-eyes/header@main | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20' | ||
- name: Setup goimports | ||
run: go install golang.org/x/tools/cmd/[email protected] | ||
- name: Check go.mod and go.sum | ||
run: go mod tidy && git diff --exit-code | ||
- name: Check format | ||
run: goimports -l -w . && git diff --exit-code | ||
- name: Run vet check | ||
run: go vet ./... | ||
- name: Run linters | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.2 | ||
skip-pkg-cache: true | ||
|
||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.20'] | ||
steps: | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: setup tparse | ||
run: go install github.com/mfridman/tparse@latest | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: run build | ||
run: make build | ||
- name: run unit tests | ||
run: make unit-tests |