1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00
This commit is contained in:
Roman Khafizianov 2023-05-31 23:36:53 +02:00
parent 3fae8fa9e4
commit d97b4a4c4f
No known key found for this signature in database
GPG key ID: F07A7D55A2684852
3 changed files with 9 additions and 14 deletions

View file

@ -26,6 +26,7 @@ jobs:
echo $(go env GOPATH)/bin >> $GITHUB_PATH
- name: Install patched gox
run: |
rm -rf $GOPATH/src/github.com/mitchellh
mkdir -p $GOPATH/src/github.com/mitchellh
cd $GOPATH/src/github.com/mitchellh
git clone https://github.com/aslakhellesoy/gox
@ -35,13 +36,6 @@ jobs:
go install github.com/mitchellh/gox
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Set env vars
env:
AMPLITUDE_KEY: ${{ secrets.AMPLITUDE_KEY }}
@ -52,15 +46,15 @@ jobs:
echo VERSION=${GITHUB_REF##*/} >> $GITHUB_ENV
echo SDKROOT=$(xcrun --sdk macosx --show-sdk-path) >> $GITHUB_ENV
echo GOPRIVATE=github.com/anyproto >> $GITHUB_ENV
echo PATH=deps:$(GOPATH)/bin:$(PATH) >> $GITHUB_ENV
echo $(pwd)/deps >> $GITHUB_PATH
echo "${GOBIN}" >> $GITHUB_PATH
git config --global url."https://${{ secrets.ANYTYPE_PAT }}@github.com/".insteadOf "https://github.com/"
- name: Go mod download
run: |
go mod download
- name: install protoc
run: |
make setup-protoc
make setup-protoc-go
- name: setup go
run: |
make setup-go
@ -198,12 +192,13 @@ jobs:
cd open
python3 tools/generate.py --platform golang
cd ..
gem install license_finder
sudo gem install license_finder
license_finder inherited_decisions add open/decisions.yml
license_finder --enabled-package-managers gomodules
- name: Install patched gox
run: |
rm -rf $GOPATH/src/github.com/mitchellh
mkdir -p $GOPATH/src/github.com/mitchellh
cd $GOPATH/src/github.com/mitchellh
git clone https://github.com/aslakhellesoy/gox

View file

@ -45,7 +45,7 @@ jobs:
- name: Generate mocks
run: |
go install github.com/golang/mock/mockgen@latest
CGO_ENABLED=0 go generate ./...
CGO_ENABLED=0 CGO_CFLAGS="-Wno-deprecated-declarations -Wno-deprecated-non-prototype -Wno-xor-used-as-pow" go generate ./...
- name: Go test
env:
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME }}
@ -57,7 +57,7 @@ jobs:
PACKAGE_NAMES=$(go list -tags nogrpcserver ./... | grep -v "github.com/anyproto/anytype-heart/cmd/grpserver" | grep -v "github.com/anyproto/anytype-heart/clientlibrary/clib")
rm -rf ~/gotestsum-report
mkdir ~/gotestsum-report
gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -p 1 $(echo $PACKAGE_NAMES) -coverprofile=coverage.out -covermode=count ./...
CGO_CFLAGS="-Wno-deprecated-declarations -Wno-deprecated-non-prototype -Wno-xor-used-as-pow" gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -p 1 $(echo $PACKAGE_NAMES) -coverprofile=coverage.out -covermode=count ./...
COVERAGE=$(go tool cover -func coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
echo "coverage_middleware $COVERAGE" | curl --data-binary @- --user "$prometheus_username:$prometheus_password" https://pushgateway.anytype.io/metrics/job/tech_quality
- name: Publish Test Report

View file

@ -43,7 +43,7 @@ lint:
test:
@echo 'Running tests...'
@ANYTYPE_LOG_NOGELF=1 go test -cover github.com/anyproto/anytype-heart/...
@ANYTYPE_LOG_NOGELF=1 CGO_CFLAGS="-Wno-deprecated-declarations -Wno-deprecated-non-prototype -Wno-xor-used-as-pow" go test -cover github.com/anyproto/anytype-heart/...
test-integration:
@echo 'Running integration tests...'