Skip to content

Commit

Permalink
ci: separate test and lint pipelines (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac authored Oct 27, 2024
1 parent afdba56 commit c5beb23
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
workflow_call:
push:
paths:
- "**.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yaml"
- "example/**"

jobs:
lint:
name: Run Go lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install dependencies
run: |
go get -t -v ./...
go install ./...
- name: Format
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Vet
run: go vet ./...
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
skip-cache: true
14 changes: 2 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
push:
branches:
- "*"
- "main"
paths:
- "**.go"
- "go.mod"
Expand All @@ -15,7 +15,7 @@ on:

jobs:
test-go:
name: Run Go lint and unit tests
name: Run unit tests
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -29,16 +29,6 @@ jobs:
run: |
go get -t -v ./...
go install ./...
- name: Format
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Vet
run: go vet ./...
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
skip-cache: true
- name: Run Go unit tests for the SDK
run: |
cp go.work.testing go.work
Expand Down

0 comments on commit c5beb23

Please sign in to comment.