forked from jina-ai/client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 3.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Version Update
on:
pull_request_target:
paths:
- requirements.txt
pull_request:
paths:
- requirements.txt
permissions:
contents: write
issues: write
pull-requests: write
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
version-update:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Install Dependencies
run: |
go mod tidy -v
pip install -r requirements.txt
pip install pydantic==1.10.2
sudo apt-get update
# https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os
wget https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-linux-x86_64.zip
unzip protoc-21.7-linux-x86_64.zip -d $HOME/.local
rm protoc-21.7-linux-x86_64.zip
# https://stackoverflow.com/a/62872353/15683245
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/protobuf/cmd/protoc-gen-go
go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
- name: Get Jina & Docarray Versions
id: versions
run: |
echo "::set-output name=JINA_VERSION::$(jina -v)"
echo "::set-output name=DOCARRAY_VERSION::$(python -c "import docarray; print(docarray.__version__)")"
- name: Download proto files
run: |
bash scripts/fetchProtos.sh ${{ steps.versions.outputs.JINA_VERSION }} ${{ steps.versions.outputs.DOCARRAY_VERSION }}
- name: Generate Golang Code from protos
run: |
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH="$PATH:$GOROOT:$GOPATH:$GOBIN:$HOME/.local/bin"
bash scripts/protogen.sh ${{ steps.versions.outputs.JINA_VERSION }} ${{ steps.versions.outputs.DOCARRAY_VERSION }}
- name: Run Tests
run: |
go mod tidy -v
go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.1.6
go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.1.6
go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.1.6
go install github.com/onsi/ginkgo/v2/ginkgo
go get github.com/onsi/gomega/...
go mod tidy -v
ginkgo --progress -v .
- name: Commit & Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: update protos for jina ${{ steps.versions.outputs.JINA_VERSION }} and docarray ${{ steps.versions.outputs.DOCARRAY_VERSION }}"
commit_options: "--signoff"
branch: ${{ github.head_ref }}
commit_user_name: "Jina Dev Bot"
commit_user_email: "dev-bot@jina.ai"
- name: Setup tmate session for debugging
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30