Skip to content

Commit d12f76f

Browse files
authored
Merge pull request #4626 from guggero/sample-conf-check
GitHub workflow: Check all command line flags are described in sample-lnd.conf
2 parents 9e75c3e + 7ea4caa commit d12f76f

File tree

4 files changed

+258
-34
lines changed

4 files changed

+258
-34
lines changed

.github/pull_request_template.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [ ] Code has been formatted with `go fmt`
1414
- [ ] Protobuf files (`lnrpc/**/*.proto`) have been formatted with
1515
`make rpc-format` and compiled with `make rpc`
16+
- [ ] New configuration flags have been added to `sample-lnd.conf`
1617
- [ ] For code and documentation: lines are wrapped at 80 characters
1718
(the tab character should be counted as 8 characters, not 4, as some IDEs do
1819
per default)

.github/workflows/main.yml

+38
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,44 @@ jobs:
202202
- name: build mobile specific code
203203
run: go build --tags="mobile" ./mobile
204204

205+
########################
206+
# sample configuration check
207+
########################
208+
sample-conf-check:
209+
name: sample configuration check
210+
runs-on: ubuntu-latest
211+
steps:
212+
- name: git checkout
213+
uses: actions/checkout@v2
214+
215+
- name: go cache
216+
uses: actions/cache@v1
217+
with:
218+
path: /home/runner/work/go
219+
key: lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
220+
restore-keys: |
221+
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
222+
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
223+
lnd-${{ runner.os }}-go-${{ env.GO_VERSION }}-
224+
lnd-${{ runner.os }}-go-
225+
226+
- name: setup go ${{ env.GO_VERSION }}
227+
uses: actions/setup-go@v2
228+
with:
229+
go-version: '~${{ env.GO_VERSION }}'
230+
231+
- name: download cache
232+
uses: actions/cache@v1
233+
with:
234+
path: /home/runner/work/download_cache
235+
key: lnd-${{ runner.os }}-download-${{ hashFiles('**/install_travis_proto.sh') }}
236+
restore-keys: |
237+
lnd-${{ runner.os }}-download-${{ hashFiles('**/install_travis_proto.sh') }}
238+
lnd-${{ runner.os }}-download-
239+
240+
- name: check all command line flags exist in sample-lnd.conf file
241+
run: make sample-conf-check
242+
205243
########################
206244
# run unit tests
207245
########################

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ rpc-check: rpc
254254
for rpc in $$(find lnrpc/ -name "*.proto" | $(XARGS) awk '/ rpc /{print $$2}'); do if ! grep -q $$rpc lnrpc/rest-annotations.yaml; then echo "RPC $$rpc not added to lnrpc/rest-annotations.yaml"; exit 1; fi; done
255255
if test -n "$$(git describe --dirty | grep dirty)"; then echo "Protos not properly formatted or not compiled with v3.4.0"; git status; git diff; exit 1; fi
256256

257+
sample-conf-check:
258+
@$(call print, "Making sure every flag has an example in the sample-lnd.conf file")
259+
for flag in $$(GO_FLAGS_COMPLETION=1 go run -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lnd -- | grep -v help | cut -c3-); do if ! grep -q $$flag sample-lnd.conf; then echo "Command line flag --$$flag not added to sample-lnd.conf"; exit 1; fi; done
260+
257261
mobile-rpc: falafel goimports
258262
@$(call print, "Creating mobile RPC from protos.")
259263
cd ./mobile; ./gen_bindings.sh $(FALAFEL_COMMIT)

0 commit comments

Comments
 (0)