-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update workflow to use jsonnet fmt/lint container image (#263)
* refactor: update workflow to use jsonnet fmt/lint container image * refactor: add fmt/lint version
- Loading branch information
1 parent
e962d5c
commit a56a05a
Showing
3 changed files
with
4 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,39 +30,13 @@ jobs: | |
with: | ||
dockerfile: ./monitoring-as-code/Dockerfile | ||
|
||
- uses: actions/setup-go@v3 | ||
|
||
- name: Set up jsonnet | ||
run: | | ||
go install github.com/google/go-jsonnet/cmd/[email protected] | ||
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] | ||
go install github.com/google/go-jsonnet/cmd/[email protected] | ||
go install github.com/google/go-jsonnet/cmd/[email protected] | ||
eval "$(go env)" | ||
PATH=$PATH:$GOPATH/bin | ||
jb init | ||
jb install https://github.com/grafana/grafonnet-lib/grafonnet | ||
jb install https://github.com/grafana/jsonnet-libs/grafana-builder | ||
- name: Jsonnet format check | ||
run: | | ||
eval "$(go env)" | ||
PATH=$PATH:$GOPATH/bin | ||
jsonnetfmt -v | ||
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s --no-sort-imports -i && git diff --exit-code --color | ||
sh ${{ github.workspace }}/monitoring-as-code/fmt.sh && git diff --exit-code --color | ||
- name: Jsonnet lint check | ||
run: | | ||
eval "$(go env)" | ||
PATH=$PATH:$GOPATH/bin | ||
jsonnet-lint -v | ||
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnet-lint -J vendor | ||
sh ${{ github.workspace }}/monitoring-as-code/lint.sh | ||
#Logs into Github registry | ||
- name: Login to GitHub Container Registry | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
echo "find . -name 'pkg' -prune -o -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s --no-sort-imports -i" | docker run -i -v "$(pwd):/app/MaC" jsonnet-dev-tool /bin/sh | ||
echo "jsonnetfmt -v && find . -name 'pkg' -prune -o -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnetfmt -n 2 --max-blank-lines 2 --string-style s --comment-style s --no-sort-imports -i" | docker run -i -v "$(pwd):/app/MaC" ghcr.io/ho-cto/sre-fmt-lint:latest /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
echo "find . -name 'pkg' -prune -o -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnet-lint -J vendor" | docker run -i -v "$(pwd):/app/MaC" jsonnet-dev-tool /bin/sh | ||
echo "jsonnet-lint -v && find . -name 'pkg' -prune -o -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | xargs -n 1 jsonnet-lint -J vendor" | docker run -i -v "$(pwd):/app/MaC" ghcr.io/ho-cto/sre-fmt-lint:latest /bin/sh |