check go work sync in unit test (#268)

* check go work sync is ran

* bump setup-go@v4

* remove go mod tidy
This commit is contained in:
Marco Argentieri
2024-08-20 11:22:59 +02:00
committed by GitHub
parent 07139786e6
commit 0fb8076c6e
3 changed files with 28 additions and 12 deletions

View File

@@ -14,6 +14,27 @@ on:
- "pkg/client-sdk/**"
jobs:
check-go-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '>=1.22.6'
- name: Run go work sync
run: go work sync
- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Changes detected after running go work sync and go mod tidy"
git diff
exit 1
fi
test-server:
name: server unit tests
runs-on: ubuntu-latest
@@ -21,9 +42,9 @@ jobs:
run:
working-directory: ./server
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ">1.17.2"
go-version: '>=1.22.6'
- uses: actions/checkout@v3
- name: check linting
uses: golangci/golangci-lint-action@v3
@@ -33,7 +54,7 @@ jobs:
- name: check code integrity
uses: securego/gosec@master
with:
args: '-severity high -quiet ./...'
args: "-severity high -quiet ./..."
- run: go get -v -t -d ./...
- name: unit testing
run: make test
@@ -45,9 +66,9 @@ jobs:
run:
working-directory: ./pkg/client-sdk
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ">1.17.2"
go-version: '>=1.22.6'
- uses: actions/checkout@v3
- name: check linting
uses: golangci/golangci-lint-action@v3
@@ -57,7 +78,7 @@ jobs:
- name: check code integrity
uses: securego/gosec@master
with:
args: '-severity high -quiet ./...'
args: "-severity high -quiet ./..."
- run: go get -v -t -d ./...
- name: unit testing
run: make test
run: make test