-
Notifications
You must be signed in to change notification settings - Fork 20
76 lines (76 loc) · 2.8 KB
/
prc.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
name: Pull Request Check
on:
pull_request:
pull:
workflow_dispatch:
permissions:
contents: read
pull-requests: read # Use with `only-new-issues` option.
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# with:
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
# submodules: 'recursive'
- name: Checkout submodules using a PAT
run: |
git config --file .gitmodules --get-regexp url | while read url; do
git config --file=.gitmodules $(echo "$url" | sed -E "s/[email protected]:|https:\/\/github.com\//https:\/\/${{ secrets.TRPC_PAT }}:${{ secrets.TRPC_PAT }}@github.com\//")
done
git submodule sync
git submodule update --init --recursive
- run: ls install/submodules/trpc-protocol
- uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Build
run: go build -v ./...
- name: Set env
run: echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Install protoc
run: PB_REL="https://github.com/protocolbuffers/protobuf/releases" && curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip && unzip -o protoc-3.15.8-linux-x86_64.zip -d $HOME/.local && ~/.local/bin/protoc --version
- name: Install flatc
run: wget https://github.com/google/flatbuffers/releases/download/v23.5.26/Linux.flatc.binary.g++-10.zip && unzip Linux.flatc.binary.g++-10.zip && mv flatc ~/go/bin/ && ~/go/bin/flatc --version
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: install mockgen
run: go install go.uber.org/mock/mockgen@latest
- run: echo $PATH
- run: export PATH=$HOME/.local/bin:$HOME/go/bin:$PATH && echo $PATH && go run ./trpc setup -f && ls -la /home/ubuntu/go/bin && file $HOME/go/bin/flatc && file $HOME/go/bin/protoc
- name: Test
run: export PATH=$HOME/.local/bin:$HOME/go/bin:$PATH && echo $PATH && go test -v -coverprofile=coverage.out ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.out
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
skip-cache: true
typos:
name: typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: typos
uses: crate-ci/typos@master
with:
config: ./.github/typosconfig.toml