Skip to content

[+] add commands config [init|upgrade], closes #514 #721

[+] add commands config [init|upgrade], closes #514

[+] add commands config [init|upgrade], closes #514 #721

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.22'
cache-dependency-path: 'src/go.sum'
- name: Cache npm packages
uses: actions/cache@v4
with:
path: |
src/webui/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Build
run: |
cd src/webui
yarn install --network-timeout 100000 && yarn build
cd ..
go build
- name: Upload webui as artifact
uses: actions/upload-artifact@v4
with:
name: webui-build
path: src/webui/build
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
working-directory: src
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.22'
cache-dependency-path: 'src/go.sum'
- name: Download webui artifact
uses: actions/download-artifact@v4
with:
name: webui-build
path: src/webui/build
- name: Test
run: |
cd src
go test -failfast -v -timeout=300s -p 1 -coverprofile=profile.cov ./...
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
base-path: src
file: src/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.22'
cache-dependency-path: 'src/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 .