1+ name : " Checks"
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ pull_request_target :
8+ types :
9+ - opened
10+ - edited
11+ - synchronize
12+ push :
13+ branches :
14+ - main
15+
16+ jobs :
17+ pr :
18+ name : Validate PR title
19+ if : contains(fromJSON('["pull_request", "pull_request_target"]'), github.event_name)
20+ runs-on : ubuntu-22.04
21+ permissions :
22+ pull-requests : read
23+ steps :
24+ - uses : amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f
25+ env :
26+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27+
28+ go :
29+ runs-on : ubuntu-22.04
30+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
31+ permissions :
32+ checks : write
33+ contents : read
34+ pull-requests : read
35+ strategy :
36+ matrix :
37+ directory :
38+ - " ."
39+ - sdk
40+ - examples
41+ steps :
42+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
43+ - uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
44+ with :
45+ go-version : " 1.21"
46+ cache-dependency-path : |
47+ ./go.sum
48+ sdk/go.sum
49+ examples/go.sum
50+ - run : make go.work
51+ - name : golangci-lint
52+ uses : golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
53+ with :
54+ version : v1.55
55+ only-new-issues : true
56+ working-directory : ${{ matrix.directory }}
57+ - run : go test ./... -short
58+ working-directory : ${{ matrix.directory }}
59+
60+ integration :
61+ name : integration tests
62+ runs-on : ubuntu-22.04
63+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
64+ needs :
65+ - go
66+ steps :
67+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
68+ - uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
69+ with :
70+ go-version : " 1.21"
71+ cache-dependency-path : |
72+ ./go.sum
73+ sdk/go.sum
74+ examples/go.sum
75+ - run : make go.work
76+ - run : go test ./integration -race
77+ - run : docker-compose up -d
78+ - run : cp example-opentdf.yaml opentdf.yaml
79+ - run : go run . start &
80+ -
run :
go install github.com/fullstorydev/grpcurl/cmd/[email protected] 81+ - run : sleep 15
82+ name : wake me up when github action runner supports docker-compose --wait
83+ - run : grpcurl -plaintext localhost:9000 list
84+ - run : grpcurl -plaintext localhost:9000 list attributes.AttributesService
85+
86+ image :
87+ name : image build
88+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
89+ runs-on : ubuntu-22.04
90+ needs : integration
91+ steps :
92+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
93+ - uses : docker/setup-buildx-action@v3
94+ 95+ with :
96+ context : .
97+ file : ./Dockerfile
98+ push : false
99+
100+ buflint :
101+ name : Protocol Buffer Lint and Gencode Up-to-date check
102+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
103+ runs-on : ubuntu-22.04
104+ steps :
105+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
106+ - uses : bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa
107+ - uses : bufbuild/buf-lint-action@044d13acb1f155179c606aaa2e53aea304d22058
108+ with :
109+ input : proto
110+ - uses : bufbuild/buf-breaking-action@a074e988ee34efcd4927079e79c611f428354c01
111+ # TODO(#212) Block on breaking changes after protos are frozen
112+ continue-on-error : true
113+ with :
114+ input : proto
115+ against : " https://github.com/opentdf/opentdf-v2-poc.git#branch=main,subdir=proto"
116+ - uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
117+ with :
118+ go-version : " 1.21"
119+ cache-dependency-path : |
120+ ./go.sum
121+ sdk/go.sum
122+ examples/attributes/go.sum
123+ - run : go get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
124+ - run : go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
125+ - run : make buf-generate
126+ - name : Restore go.mod after installing protoc-gen-doc
127+ run : git restore go.mod go.sum
128+ - run : git diff
129+ - run : git diff-files --ignore-submodules
130+ - name : Check that files have been formatted before PR submission
131+ run : git diff-files --quiet --ignore-submodules
132+
133+ ci :
134+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
135+ needs :
136+ - pr
137+ - go
138+ - integration
139+ - image
140+ - buflint
141+ runs-on : ubuntu-latest
142+ steps :
143+ - if : contains(needs.*.result, 'failure')
144+ run : exit 1
145+
146+ license :
147+ if : contains(fromJSON('["push", "pull_request"]'), github.event_name)
148+ name : license check
149+ runs-on : ubuntu-22.04
150+ steps :
151+ - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
152+ - uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
153+ with :
154+ go-version : ' 1.21'
155+ cache : false
156+ - name : install go-licenses
157+ run : go install github.com/google/go-licenses@5348b744d0983d85713295ea08a20cca1654a45e
158+ - name : check licenses
159+ run : go-licenses check --disallowed_types=forbidden --include_tests ./...
160+
0 commit comments