mirror of
https://github.com/aljazceru/ark.git
synced 2026-01-17 10:44:21 +01:00
* tx history * fix * fix * pr review refactor * pr review refactor * fix * pr review refactor * exclude gosec G115 Integer Overflow Conversion * ignore some gosec errs * ignore some gosec errs * ignore createdat in test assertion * Fixes (#7) * Fixes * Fixes * Update golang (#8) * update gha golangci-lint version * update gha golangci-lint version * fix linting issues * fix linting issues * fix linting issues * add linter timeout --------- Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
87 lines
2.0 KiB
YAML
Executable File
87 lines
2.0 KiB
YAML
Executable File
name: ci_unit
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "server/**"
|
|
- "pkg/client-sdk/**"
|
|
branches: [master]
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "server/**"
|
|
- "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
|
|
defaults:
|
|
run:
|
|
working-directory: ./server
|
|
steps:
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '>=1.22.6'
|
|
- uses: actions/checkout@v3
|
|
- name: check linting
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.61
|
|
working-directory: ./server
|
|
args: --timeout 5m
|
|
- name: check code integrity
|
|
uses: securego/gosec@master
|
|
with:
|
|
args: "-severity high -quiet -exclude=G115 ./..."
|
|
- run: go get -v -t -d ./...
|
|
- name: unit testing
|
|
run: make test
|
|
|
|
test-sdk:
|
|
name: sdk unit tests
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./pkg/client-sdk
|
|
steps:
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '>=1.22.6'
|
|
- uses: actions/checkout@v3
|
|
- name: check linting
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.61
|
|
working-directory: ./pkg/client-sdk
|
|
args: --timeout 5m
|
|
- name: check code integrity
|
|
uses: securego/gosec@master
|
|
with:
|
|
args: "-severity high -quiet -exclude=G115 ./..."
|
|
- run: go get -v -t -d ./...
|
|
- name: unit testing
|
|
run: make test
|