Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions .github/workflows/toolkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM oraclelinux:9-slim
RUN microdnf -y update
COPY bin/* /usr/bin/
2 changes: 1 addition & 1 deletion src/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading