-
Notifications
You must be signed in to change notification settings - Fork 12
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
PMM-7806: add compatibility with percona pg exporter #68
Changes from all commits
cbd7ace
e4258fe
46b20fc
0dc3950
9b2058d
8cbe0d6
fe3a5dd
318af7c
074ad4a
ceb3788
60adc4c
675b953
f4f2499
6082c4e
c18424f
c09bffd
d6f75c3
c9adb32
7124736
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.17 | ||
postgresql-image: | ||
- postgres:10 | ||
- postgres:11 | ||
- postgres:12 | ||
- postgres:13 | ||
- postgres:14 | ||
runs-on: ubuntu-latest | ||
# The environment this job references | ||
environment: | ||
name: CI | ||
steps: | ||
- name: Set up Go release | ||
uses: percona-platform/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: percona-platform/checkout@v2 | ||
- name: Run checks | ||
run: | | ||
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint | ||
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog | ||
bin/golangci-lint run -c=.golangci-required.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-check | ||
bin/golangci-lint run -c=.golangci.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-review | ||
- name: Run Tests | ||
run: | | ||
sudo chown 999:999 testdata/ssl/server/* | ||
sudo chmod 600 testdata/ssl/server/* | ||
docker-compose up -d | ||
make | ||
make test | ||
env: | ||
POSTGRESQL_IMAGE: ${{ matrix.postgresql-image }} | ||
- name: Run debug commands on failure | ||
if: ${{ failure() }} | ||
run: | | ||
env | ||
go version | ||
go env | ||
pwd | ||
git status | ||
docker --version | ||
docker-compose --version | ||
docker-compose logs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ endif | |
%: common-% ; | ||
|
||
.PHONY: common-all | ||
common-all: precheck style check_license lint yamllint unused build test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we removed these two targets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in original exporter we don't have license headers, and I moved yaml as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you check if this target was removed explicitly or if it was introduced later by upstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved configs from "old" pg exporter. It is a diff for upstream. |
||
common-all: precheck style lint unused build test | ||
|
||
.PHONY: common-style | ||
common-style: | ||
|
@@ -136,17 +136,6 @@ common-style: | |
exit 1; \ | ||
fi | ||
|
||
.PHONY: common-check_license | ||
common-check_license: | ||
@echo ">> checking license header" | ||
@licRes=$$(for file in $$(find . -type f -iname '*.go' ! -path './vendor/*') ; do \ | ||
awk 'NR<=3' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \ | ||
done); \ | ||
if [ -n "$${licRes}" ]; then \ | ||
echo "license header checking failed:"; echo "$${licRes}"; \ | ||
exit 1; \ | ||
fi | ||
|
||
.PHONY: common-deps | ||
common-deps: | ||
@echo ">> getting dependencies" | ||
|
@@ -204,15 +193,6 @@ else | |
endif | ||
endif | ||
|
||
.PHONY: common-yamllint | ||
common-yamllint: | ||
@echo ">> running yamllint on all YAML files in the repository" | ||
ifeq (, $(shell which yamllint)) | ||
@echo "yamllint not installed so skipping" | ||
else | ||
yamllint . | ||
endif | ||
|
||
# For backward-compatibility. | ||
.PHONY: common-staticcheck | ||
common-staticcheck: lint | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract running checks to a separate job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it from the original, exporter. We can think about some generic actions in scope of other task and PR, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you create a task for it then, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please clarify what exactly this ticket should be about? Create shared GHA for checks (ie linters)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracting checks to a separate job.