Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: One stop RPC/HTTP call technology solution #80

Merged
merged 280 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
0f2b1a7
feat(platform): fix sql file
Nihilism0 Aug 27, 2023
24e35be
feat(platform): fix sql file
Nihilism0 Aug 27, 2023
fbbb269
feat(platform): fix sql file
Nihilism0 Aug 27, 2023
324e36d
Merge pull request #3 from StellarisW/feat-platform-2
StellarisW Aug 27, 2023
f2b8b3d
feat(platform): add builtin registry
StellarisW Aug 27, 2023
c209e13
feat(platform): add builtin registry
StellarisW Aug 27, 2023
c90ea84
feat(platform): add dispatcher
StellarisW Aug 28, 2023
beb128d
feat(platform): Add GetRepositoryArchive && GetRepositoryArchive
Nihilism0 Aug 28, 2023
3e1f073
feat: initialize the project and inject mock data
cheerioInf Sep 5, 2023
811c73d
Merge pull request #5 from cheerioInf/feat-platform-web
StellarisW Sep 5, 2023
e5ff81d
feat(platform): add dispatcher
StellarisW Sep 30, 2023
013a77d
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Sep 30, 2023
58f83b0
Merge pull request #4 from StellarisW/feat-platform-2
StellarisW Sep 30, 2023
449179b
Merge pull request #6 from StellarisW/feat-platform
Nihilism0 Sep 30, 2023
4ef31ea
feat(platform): add server initialization
StellarisW Oct 1, 2023
26949c2
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Oct 1, 2023
9cc976c
feat(platform): add api arch
StellarisW Oct 1, 2023
4043e01
feat(platform): add order request fields
StellarisW Oct 1, 2023
4e1bb36
refactor(platform): move kitex-gen file
StellarisW Oct 1, 2023
bf0a1a8
feat(platform): add thrift field
StellarisW Oct 1, 2023
81d312b
feat(platform): add thrift field
StellarisW Oct 1, 2023
b5e7a3b
feat(platform): add thrift field
StellarisW Oct 1, 2023
d41721e
feat(platform): Add api logic && service logic && database func
Nihilism0 Oct 1, 2023
9c8c914
fix(platform): update thrift field
StellarisW Oct 2, 2023
3061b12
fix(platform): update thrift field
StellarisW Oct 2, 2023
fde07ac
fix(platform): update thrift field
StellarisW Oct 2, 2023
8cced58
fix(platform): update thrift field
StellarisW Oct 2, 2023
3c82ce1
fix(platform): update thrift field
StellarisW Oct 2, 2023
4bb2cc7
fix(platform): update thrift field
StellarisW Oct 2, 2023
8653b51
feat(platform): init api, agent start arch
StellarisW Oct 4, 2023
1023c71
feat(platform): init api, agent start arch
StellarisW Oct 4, 2023
a06ba32
feat(platform): registry logic
StellarisW Oct 4, 2023
2a94f68
feat(platform): add dispatcher
StellarisW Oct 5, 2023
72c2f19
feat(platform): add logic that api service push tasks to agent service
StellarisW Oct 5, 2023
55358fc
refactor(platform): generator code logic
StellarisW Oct 5, 2023
11af2b0
feat(platform): generator code logic
StellarisW Oct 6, 2023
b8efc83
refactor(platform): api manager logic
StellarisW Oct 6, 2023
3244ef5
refactor(platform): api thrift model
StellarisW Oct 6, 2023
982e102
refactor(platform): api thrift model
StellarisW Oct 6, 2023
5136d2f
refactor(platform): api thrift model
StellarisW Oct 6, 2023
e4e04f3
feat(platform): fix api and registry task update logic
StellarisW Oct 6, 2023
1e987f6
refactor(platform): move web code
StellarisW Oct 6, 2023
cd7b728
refactor(platform): move docs
StellarisW Oct 6, 2023
f99e8af
fix: prettier config and replaced logo
cheerioInf Oct 6, 2023
6d470e1
fix: prettier config and replaced logo
cheerioInf Oct 6, 2023
4c894bb
fix(platform): fix model
StellarisW Oct 6, 2023
a43896a
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Oct 6, 2023
379b224
refactor(platform): kitex gen code
StellarisW Oct 6, 2023
3e47fd6
refactor(platform): kitex gen code
StellarisW Oct 6, 2023
79ac423
refactor(platform): refactor api logic code
StellarisW Oct 6, 2023
86703c0
refactor(platform): refactor api logic code
StellarisW Oct 6, 2023
3c38e56
feat(platform): fix filepath bug && add repo interface func
Nihilism0 Oct 7, 2023
d6fcd30
feat: mock data (#8)
cheerioInf Oct 7, 2023
4f795ee
Merge pull request #9 from StellarisW/feat-platform
Nihilism0 Oct 10, 2023
2797a93
feat(platform): fix github logic && add parser
Nihilism0 Oct 10, 2023
b3309da
feat(platform): fix generate code && add parser
Nihilism0 Oct 17, 2023
2f789b8
feat(platform): add proto parser
Nihilism0 Oct 18, 2023
9769394
feat(platform): fix proto parser
Nihilism0 Oct 21, 2023
fdfac88
feat(platform): add comments
Nihilism0 Oct 21, 2023
113fd34
feat(platform): add template rpc handler
StellarisW Oct 21, 2023
140f2b4
fix(platform): 修复内置服务中心服务过期逻辑
StellarisW Oct 21, 2023
de7790f
feat(platform): add comments
Nihilism0 Oct 21, 2023
172f637
feat(platform): change task model from json to thrift
Nihilism0 Oct 22, 2023
b12b37f
Merge branch 'feat-platform' into feat-platform-2
StellarisW Oct 23, 2023
3fd1199
Merge pull request #11 from StellarisW/feat-platform-2
StellarisW Oct 23, 2023
89cadf6
feat(platform): builtin registry info store in redis
StellarisW Oct 30, 2023
b90ac42
feat(platform): reuse service id
StellarisW Oct 30, 2023
66512fe
feat(platform): repo clients store in cache
StellarisW Oct 30, 2023
b8a7ac4
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Oct 30, 2023
29d1997
feat(platform): finish a part of agent logic
Nihilism0 Nov 2, 2023
01c01d6
Merge remote-tracking branch 'origin/feat-platform-2' into feat-platf…
Nihilism0 Nov 2, 2023
11f042d
feat(platform): cron job logic
StellarisW Nov 3, 2023
1a9bf9d
refactor(platform): dao logic
StellarisW Nov 5, 2023
92b7bbc
Merge pull request #12 from StellarisW/feat-platform
Nihilism0 Nov 5, 2023
2d8a512
feat(platform): idl entity add idl type field
StellarisW Nov 5, 2023
c320531
feat(platform): idl entity add idl type field
StellarisW Nov 5, 2023
95503b9
Merge pull request #13 from StellarisW/feat-platform
Nihilism0 Nov 5, 2023
0e9c88a
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Nov 5, 2023
df891f6
Merge pull request #14 from StellarisW/feat-platform
Nihilism0 Nov 5, 2023
a03aba3
fix(platform): logger config
StellarisW Nov 5, 2023
1f90285
fix(platform): redis config
StellarisW Nov 5, 2023
a382b26
feat(platform): optimize builtin registry logic
StellarisW Nov 5, 2023
b711afe
feat(platform): update comment
StellarisW Nov 5, 2023
f10f5da
feat(platform): finish agent logic
Nihilism0 Nov 5, 2023
f40ad78
Merge pull request #15 from StellarisW/feat-platform-2
StellarisW Nov 5, 2023
b1e8c6d
feat(platform): update comment
StellarisW Nov 5, 2023
a80c111
feat(platform): finish sync IDLs
Nihilism0 Nov 6, 2023
bb3af7d
Merge pull request #16 from StellarisW/feat-platform-2
StellarisW Nov 7, 2023
72250c5
fix(platform): fix field err
StellarisW Nov 7, 2023
e2ea8c7
Merge pull request #17 from StellarisW/feat-platform
Nihilism0 Nov 8, 2023
2ceac44
fix(platform): fix err
StellarisW Nov 8, 2023
9936509
fix(platform): add service_repository_id field in thrift
StellarisW Nov 9, 2023
d38b332
Merge pull request #18 from StellarisW/feat-platform
Nihilism0 Nov 9, 2023
550fb14
feat(platform): fix sql and sql table, add storeServiceRepository whe…
Nihilism0 Nov 10, 2023
227ed75
Merge remote-tracking branch 'origin/feat-platform-2' into feat-platf…
Nihilism0 Nov 10, 2023
e09864e
feat(platform): fix err, add return value for addRepository
Nihilism0 Nov 10, 2023
4ff8c07
feat(platform): add the duplicate entry situation and fix bug
Nihilism0 Nov 10, 2023
95b1be0
fix(platform): add store_type field in thrift
StellarisW Nov 10, 2023
1bfff0c
fix(platform): add store_type field in thrift
StellarisW Nov 10, 2023
3575633
Merge pull request #20 from StellarisW/feat-platform
Nihilism0 Nov 10, 2023
9e23794
fix(platform): add store_type field in thrift
StellarisW Nov 10, 2023
0db7797
Merge pull request #21 from StellarisW/feat-platform
Nihilism0 Nov 10, 2023
ccd90c0
fix(platform): fix bug
Nihilism0 Nov 10, 2023
2234a93
fix(platform): fix sql bug
Nihilism0 Nov 10, 2023
02f641f
Merge pull request #19 from StellarisW/feat-platform-2
StellarisW Nov 10, 2023
0eb1937
fix(platform): fix repo relative bug
StellarisW Nov 11, 2023
f447acd
fix(platform): fix idl relative bug
StellarisW Nov 11, 2023
c89740f
Merge pull request #22 from StellarisW/feat-platform
Nihilism0 Nov 11, 2023
2c0e31a
fix(platform): fix bug
Nihilism0 Nov 11, 2023
6040dc2
Merge pull request #23 from StellarisW/feat-platform-2
StellarisW Nov 11, 2023
65f74ca
fix(platform): fix idl relative bug
StellarisW Nov 11, 2023
97feb69
Merge pull request #24 from StellarisW/feat-platform
Nihilism0 Nov 11, 2023
4d7a615
fix(platform): fix repo private bug
Nihilism0 Nov 11, 2023
8987900
Merge pull request #25 from StellarisW/feat-platform-2
StellarisW Nov 11, 2023
2d9845b
fix(platform): fix regular expression
Nihilism0 Nov 12, 2023
3bb2ada
Merge pull request #26 from StellarisW/feat-platform-2
StellarisW Nov 12, 2023
295b8ec
fix(platform): fix branch bug
Nihilism0 Nov 12, 2023
0fba68e
Merge pull request #27 from StellarisW/feat-platform-2
StellarisW Nov 12, 2023
10e5667
fix(platform): fix branch bug
Nihilism0 Nov 12, 2023
a5fdf1e
Merge pull request #28 from StellarisW/feat-platform-2
StellarisW Nov 12, 2023
aa93e27
fix(platform): fix idl initialize bug
Nihilism0 Nov 12, 2023
02963fb
fix(platform): fix idl initialize bug
Nihilism0 Nov 12, 2023
b17d1b3
fix(platform): fix idl relative bug
StellarisW Nov 12, 2023
34041b5
feat(platform): return total param
StellarisW Nov 12, 2023
cff4edd
fix(platform): dao field err
StellarisW Nov 13, 2023
d1964f8
Merge pull request #31 from StellarisW/feat-platform
Nihilism0 Nov 17, 2023
8eab4ac
fix(platform): fix dao && add logic
Nihilism0 Nov 19, 2023
1e421b8
Merge pull request #32 from StellarisW/feat-platform-2
StellarisW Nov 19, 2023
5fc8f61
style(platform): change var name
StellarisW Nov 19, 2023
f4b57e7
fix(platform): fix web bug
StellarisW Nov 19, 2023
5975b91
style(platform): change tmp dir path
StellarisW Nov 19, 2023
d2d079c
fix(platform): sync bug
StellarisW Nov 27, 2023
f5584fd
Feat platform (#33)
cheerioInf Dec 6, 2023
6fe985d
update
tanbowen03 Dec 6, 2023
f438dba
feat(platform): add static fs
StellarisW Dec 6, 2023
70246ec
feat(platform): change log level
StellarisW Dec 6, 2023
c28dff7
chore(platform): add docker build
StellarisW Dec 6, 2023
52ba037
fix(platform): create temp dir bug
StellarisW Dec 6, 2023
ffc3058
chore(platform): fix docker-compose.yml
StellarisW Dec 6, 2023
f1d0a62
fix(platform): router path err
StellarisW Dec 6, 2023
febefe4
feat(platform): update task worker logic
StellarisW Dec 7, 2023
d677f97
feat(platform): add query params
StellarisW Dec 7, 2023
f8dc430
fix(platform): favicon.ico file router
StellarisW Dec 7, 2023
9984211
fix(platform): set up initialization client so that the private gitla…
Nihilism0 Dec 7, 2023
1adcd1a
fix(platform): set up initialization client so that the private gitla…
Nihilism0 Dec 10, 2023
bc5837a
chore: add sub ci
li-jin-gou Dec 10, 2023
28052f4
feat(platform): add token feature
StellarisW Dec 10, 2023
8903741
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 10, 2023
0d411d3
chore: use gofumpt
li-jin-gou Dec 10, 2023
daa3b6a
format(platform): sql format
StellarisW Dec 10, 2023
316a3db
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 10, 2023
da907d1
chore: use gofumpt
li-jin-gou Dec 10, 2023
0e4d424
Merge branch 'main' into feat-platform
li-jin-gou Dec 10, 2023
6854208
fix(platform): update repository branch bug
StellarisW Dec 10, 2023
b1db447
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 10, 2023
98bec02
Merge branch 'main' into feat-platform
li-jin-gou Dec 10, 2023
a0fbf48
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 11, 2023
4020fd9
fix(platform): token router
StellarisW Dec 11, 2023
70fcdd2
fix(platform): panic err
StellarisW Dec 11, 2023
73e5667
chore: modify licenses header
li-jin-gou Dec 11, 2023
92bd46b
chore: modify licenses header
li-jin-gou Dec 11, 2023
dcc059b
chore: modify licenses header
li-jin-gou Dec 11, 2023
dec1c25
chore: modify licenses header
li-jin-gou Dec 11, 2023
7dee6fd
chore: use gofumpt
li-jin-gou Dec 11, 2023
0c523d1
chore: use `time.Since` instead of `time.Now().Sub`
li-jin-gou Dec 11, 2023
d67cfcf
fix(platform): add log
StellarisW Dec 11, 2023
e51b409
fix(platform): get errx code
StellarisW Dec 11, 2023
b41a594
fix(platform): get repo client bug
StellarisW Dec 11, 2023
5b7d5c0
fix(platform): del repo client when update repo info in db
StellarisW Dec 11, 2023
27ef403
fix(platform): add default domain when add token
StellarisW Dec 11, 2023
0358b89
fix(platform): add idl err
StellarisW Dec 11, 2023
7c2f8b1
format(platform): delete user code
StellarisW Dec 11, 2023
88fa11a
optimize(platform): agent task process logic
StellarisW Dec 12, 2023
5c1debd
optimize(platform): project config
StellarisW Dec 12, 2023
9d071eb
fix(platform): fix get token info
StellarisW Dec 12, 2023
5a33049
fix(platform): fix token bug
StellarisW Dec 12, 2023
a883951
fix(platform): repo status change to inactive bug
StellarisW Dec 12, 2023
4a0b3f1
fix(platform): idl add status field
StellarisW Dec 12, 2023
5839064
fix(platform): get idl info return service repository info
StellarisW Dec 13, 2023
15b8ed7
fix(platform): disable h2c
StellarisW Dec 13, 2023
616c55c
fix(platform): get idl info return service repository info
StellarisW Dec 13, 2023
0626368
fix(platform): get idl info bug using service_name
StellarisW Dec 13, 2023
0604720
fix(platform): idl info search err
StellarisW Dec 13, 2023
a838e16
fix(platform): fix typo
StellarisW Dec 13, 2023
5bb7b7a
refactor(platform): format base middleware use
StellarisW Dec 13, 2023
3876880
update
cheerioInf Dec 13, 2023
70c9c9b
fix
cheerioInf Dec 13, 2023
ade0af0
fix
cheerioInf Dec 13, 2023
ea8907b
fix
cheerioInf Dec 13, 2023
b17bd61
fix
cheerioInf Dec 13, 2023
ea46308
feat(platform): cwgo command add "module" param
StellarisW Dec 13, 2023
4b0a296
feat(platform): service name escape
StellarisW Dec 13, 2023
0002d0b
fix(platform): get idl info db sql err
StellarisW Dec 13, 2023
3dc183c
fix
cheerioInf Dec 13, 2023
fec5a82
fix
cheerioInf Dec 13, 2023
c6d810a
fix(platform): generate code path
StellarisW Dec 13, 2023
1c61b0a
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 13, 2023
3145816
fix(platform): generate code bug
StellarisW Dec 13, 2023
4f5c70a
chore: modify IgnoreRecordNotFoundError to true
li-jin-gou Dec 13, 2023
af9eb3f
Merge pull request #34 from StellarisW/feat-platform
Nihilism0 Dec 13, 2023
0ab4dac
fix(platform): delete the original code before pushing it
Nihilism0 Dec 13, 2023
cdfde39
format(platform): delete empty code
StellarisW Dec 13, 2023
f269b86
fix(platform): validate token for repo gitlab
StellarisW Dec 13, 2023
f4155b8
refactor(platform): delete dynamic worker feature
StellarisW Dec 13, 2023
c77f90d
refactor(platform): cmd
StellarisW Dec 13, 2023
9a58e9c
fix
cheerioInf Dec 14, 2023
5c38a17
fix
cheerioInf Dec 14, 2023
36a1a82
fix
cheerioInf Dec 14, 2023
cd52193
fix(platform): get lasted commit to get archive
Nihilism0 Dec 14, 2023
d2b7d86
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
Nihilism0 Dec 14, 2023
f100857
fix(platform): add archive option
Nihilism0 Dec 14, 2023
394f445
fix(platform): del repo file err
StellarisW Dec 14, 2023
afb4f93
fix(platform): idl auto sync err
StellarisW Dec 14, 2023
8029fd8
fix
cheerioInf Dec 14, 2023
a730654
Merge branch 'main' into feat-platform
li-jin-gou Dec 15, 2023
d0bdb4a
fix(platform): get task async
StellarisW Dec 15, 2023
a192576
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 15, 2023
8c1abb5
feat(platform): add log
StellarisW Dec 16, 2023
946d841
feat(platform): support gitlab group token
StellarisW Dec 16, 2023
f0c7483
optimize(platform): add idl and sync idl logic
StellarisW Dec 16, 2023
21d471f
optimize(platform): push generate code to service repo logic
StellarisW Dec 16, 2023
1a72a00
test(platform): delete test file
StellarisW Dec 16, 2023
21fbf38
feat(platform): add agent code template
StellarisW Dec 16, 2023
55d92f7
feat(platform): add config example
StellarisW Dec 16, 2023
e9b36ed
feat(platform): update gitignore
StellarisW Dec 16, 2023
30d6297
refactor(platform): hertz generate code use thriftgo template slim
StellarisW Dec 16, 2023
48ca756
feat(platform): support proto idls
StellarisW Dec 17, 2023
809ac06
fix(platform): config set up bug
StellarisW Dec 17, 2023
a7e3f61
fix(platform): sync idl update status bug
StellarisW Dec 17, 2023
3601cd6
fix(platform): search valid token logic
StellarisW Dec 17, 2023
b562570
refactor(platform): delete unused code
StellarisW Dec 17, 2023
9fb1412
fix(platform): thrift file use cwgo proto param
StellarisW Dec 17, 2023
b62e030
fix(platform): add log
StellarisW Dec 17, 2023
69635be
fix(platform): first push to repo bug
StellarisW Dec 17, 2023
9319e60
fix(platform): first push to repo bug
StellarisW Dec 17, 2023
a642667
chore: add license header
li-jin-gou Dec 17, 2023
59ac397
fix(platform): push to repo bug
StellarisW Dec 17, 2023
d5e097a
Merge remote-tracking branch 'origin/feat-platform' into feat-platform
StellarisW Dec 17, 2023
d5e4cde
fix(platform): push to repo bug
StellarisW Dec 17, 2023
08d490d
format(platform): delete retry err log
StellarisW Dec 17, 2023
c24ab82
format(platform): delete debug log
StellarisW Dec 17, 2023
6263fd4
chore(platform): install protoc
StellarisW Dec 17, 2023
7a7c452
style(platform): gofumpt and golangci-lint
StellarisW Dec 17, 2023
c23a2cb
build(platform): update go.mod
StellarisW Dec 17, 2023
666b899
build(platform): update go.mod
StellarisW Dec 17, 2023
744b378
build(platform): update go.mod
StellarisW Dec 17, 2023
b909059
chore: modify ci go version
li-jin-gou Dec 17, 2023
618e6a4
chore: modify ci go version
li-jin-gou Dec 17, 2023
1da7ec1
chore: modify ci go version
li-jin-gou Dec 17, 2023
b0d80bc
fix
cheerioInf Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 19 additions & 36 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,34 @@ jobs:

- name: Check License Header
uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check Spell
- name: typos-action
uses: crate-ci/typos@master

staticcheck:
runs-on: [ self-hosted, X64 ]
resolve-modules:
name: resolve module
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Checkout Repo
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
reviewdog-${{ runner.os }}-go-

- uses: reviewdog/action-staticcheck@v1
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-review
# Report all results.
filter_mode: nofilter
# Exit with 1 when it find at least one finding.
fail_on_error: true
# Set staticcheck flags
staticcheck_flags: -checks=inherit,-SA1029
- id: set-matrix
run: ./hack/resolve-modules.sh

lint:
runs-on: [ self-hosted, X64 ]
name: lint module
runs-on: ubuntu-latest
needs: resolve-modules
strategy:
matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Golangci Lint
# https://golangci-lint.run/
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ${{ matrix.workdir }}
args: -E gofumpt
skip-pkg-cache: true
33 changes: 18 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,30 @@ name: Tests
on: [ push, pull_request ]

jobs:
unit-benchmark-test:
strategy:
matrix:
go: [ 1.18, 1.19 ]
os: [ X64 ]
runs-on: ${{ matrix.os }}
ut:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
go-version: 1.20.1

# block scenario, comment temporarily
# - uses: actions/cache@v3
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Module cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go

- name: Unit Test
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
run: make test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ output/*

# mac
.DS_Store

# platform
/platform/server/log/
/platform/manifest/config/config-dev.yaml
/platform/manifest/config/config-pro.yaml
/platform/dist/


2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ header:

paths-ignore:
- "example/**"
- "platform/server/shared/kitex_gen/**"
- "platform/server/cmd/api/internal/biz/model/**"

comment: on-failure
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
TOOLS_SHELL="./hack/tools.sh"

.PHONY: test
test:
@${TOOLS_SHELL} test
@echo "go test finished"



.PHONY: vet
vet:
@${TOOLS_SHELL} vet
@echo "vet check finished"
22 changes: 22 additions & 0 deletions hack/resolve-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# This is used by the linter action.
# Recursively finds all directories with a go.mod file and creates
# a GitHub Actions JSON output option.

set -o errexit

HOME=$(
cd "$(dirname "${BASH_SOURCE[0]}")" &&
cd .. &&
pwd
)

source "${HOME}/hack/util.sh"
all_modules=$(util::find_modules)
PATHS=""
for mod in $all_modules; do
PATHS+=$(printf '{"workdir":"%s"},' ${mod})
done

echo "::set-output name=matrix::{\"include\":[${PATHS%?}]}"
51 changes: 51 additions & 0 deletions hack/tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

HOME=$(
cd "$(dirname "${BASH_SOURCE[0]}")" &&
cd .. &&
pwd
)

source "${HOME}/hack/util.sh"

all_modules=$(util::find_modules)

# test all mod
function test() {
for mod in $all_modules; do
pushd "$mod" >/dev/null &&
echo "go test $(sed -n 1p go.mod | cut -d ' ' -f2)" &&
go test -race -covermode=atomic -coverprofile=coverage.out ./...
popd >/dev/null || exit
done
}

# vet all mod
function vet() {
for mod in $all_modules; do
pushd "$mod" >/dev/null &&
echo "go vet $(sed -n 1p go.mod | cut -d ' ' -f2)" &&
go vet -stdmethods=false ./...
popd >/dev/null || exit
done
}

function help() {
echo "use: test,vet"
}

case $1 in
vet)
vet
;;
test)
test
;;
*)
help
;;
esac
15 changes: 15 additions & 0 deletions hack/util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# find all go mod path
# returns an array contains mod path
function util::find_modules() {
find . -not \( \
\( \
-path './output' \
-o -path './.git' \
-o -path '*/third_party/*' \
-o -path '*/vendor/*' \
-o -path '*/example/*' \
\) -prune \
\) -name 'go.mod' -print0 | xargs -0 -I {} dirname {}
}
Loading
Loading