Skip to content

[*] improve Prometheus sink and Docker setup docs #829

[*] improve Prometheus sink and Docker setup docs

[*] improve Prometheus sink and Docker setup docs #829

Workflow file for this run

name: Go Build & Test
on:
push:
branches:
- master
pull_request:
paths-ignore: ['docs/**', 'mkdocs.yml']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Golang
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: 'go.sum'
- name: Cache npm packages
uses: actions/cache@v4
with:
path: |
internal/webui/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Build
run: |
cd internal/webui
yarn install --network-timeout 100000 && yarn build
cd -
go build ./cmd/pgwatch
- name: Upload webui as artifact
uses: actions/upload-artifact@v4
with:
name: webui-build
path: internal/webui/build
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
test:
if: true # false to skip job during debug
needs: build
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Golang
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: 'go.sum'
- name: Download webui artifact
uses: actions/download-artifact@v4
with:
name: webui-build
path: internal/webui/build
- name: Test
run: |
go test -failfast -v -timeout=300s -p 1 -coverprofile=profile.cov ./...
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: profile.cov
goreleaser:
if: true # false to skip job during debug
needs: build
runs-on: ubuntu-latest
name: GoReleaser
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Golang
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache-dependency-path: 'go.sum'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --snapshot --skip=publish --clean
test-docker-images:
if: true # false to skip job during debug
needs: build
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build Docker Image
shell: bash
run: |
docker build \
--build-arg GIT_TIME=`git show -s --format=%cI HEAD` \
--build-arg GIT_HASH=`git show -s --format=%H HEAD` \
--build-arg VERSION=`git rev-parse --abbrev-ref HEAD` \
-t cybertecpostgresql/pgwatch:latest \
-f docker/Dockerfile .