Compare commits

...

1 Commits

Author SHA1 Message Date
Nurlan Moldomurov
25c4dd2b92 PMM-7 CI pipelines 2025-02-17 18:39:57 +03:00
4 changed files with 43 additions and 4 deletions

34
.github/workflows/go.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
push:
branches:
- 3.x
pull_request:
branches:
- 3.x
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Install dependencies
run: go mod download
working-directory: src/go
- name: Setup environment
run: make env-up
working-directory: src/go
- name: Run tests
run: go test ./...
working-directory: src/go

View File

@@ -20,12 +20,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
- name: Build
run: cd src/go; make linux-amd64; cd ../../
working-directory: src/go
run: make linux-amd64
- name: Build the Docker image
run: echo "FROM oraclelinux:9-slim" > Dockerfile; echo "RUN microdnf -y update" >> Dockerfile; echo "COPY bin/* /usr/bin/" >> Dockerfile; docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }}
run: docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.29.0
with:

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM oraclelinux:9-slim
RUN microdnf -y update
COPY bin/* /usr/bin/

View File

@@ -173,7 +173,7 @@ test: ## Run tests
format: ## Format source code.
gofumpt -w -s $(FILES)
gofumports -local github.com/percona/pmm-managed -l -w $(FILES)
gofumports -local github.com/percona/percona-toolkit -l -w $(FILES)
vet: ## Run vet on Go code
@echo ">> vetting code"