Skip to content

build(deps): Bump the go-dependencies group across 1 directory with 13 updates #905

build(deps): Bump the go-dependencies group across 1 directory with 13 updates

build(deps): Bump the go-dependencies group across 1 directory with 13 updates #905

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: go build -v ./...
- name: Run tests with coverage
run: |
PACKAGES=$(go list ./... | grep -v internal/gui | grep -v /cmd/)
COVERPKG=$(go list ./... | grep -v testutil | grep -v /e2e | grep -v internal/gui | grep -v /cmd/ | tr '\n' ',')
go test -v -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$COVERPKG $PACKAGES
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.txt
flags: unittests
name: codecov-suve-unit
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
gui-go-test:
name: GUI Go Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install Wails dependencies (CGO)
run: |
for i in {1..5}; do sudo apt-get update && break || sleep $((i * 5)); done
for i in {1..5}; do sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config && break || sleep $((i * 5)); done
- name: Create dummy frontend dist
run: mkdir -p internal/gui/frontend/dist && touch internal/gui/frontend/dist/index.html
- name: Run GUI Go tests
run: |
CGO_ENABLED=1 go test -v -race -tags=production,webkit2_41 ./internal/gui/...
e2e:
name: E2E Test
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:4
ports:
- 4566:4566
env:
SERVICES: ssm,secretsmanager,events
DEBUG: 0
options: >-
--health-cmd "curl -f http://localhost:4566/_localstack/health"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Wait for localstack
run: |
timeout 60 bash -c 'until curl -sf http://localhost:4566/_localstack/health; do sleep 2; done'
- name: Run e2e tests with coverage
run: |
COVERPKG=$(go list ./... | grep -v testutil | grep -v /e2e | grep -v internal/gui | grep -v /cmd/ | tr '\n' ',')
go test -v -race -tags e2e -coverprofile=coverage-e2e.txt -covermode=atomic -coverpkg=$COVERPKG ./e2e/...
env:
SUVE_LOCALSTACK_EXTERNAL_PORT: 4566
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage-e2e.txt
flags: e2e
name: codecov-suve-e2e
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
- name: Run golangci-lint (default build)
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=5m
- name: Create dummy frontend dist for production lint
run: mkdir -p internal/gui/frontend/dist && touch internal/gui/frontend/dist/index.html
- name: Install Wails dependencies (CGO)
run: |
for i in {1..5}; do sudo apt-get update && break || sleep $((i * 5)); done
for i in {1..5}; do sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config && break || sleep $((i * 5)); done
- name: Run golangci-lint (production build)
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=5m --build-tags=production,webkit2_41
- name: Run goroutinectx
run: go run github.com/mpyw/goroutinectx/cmd/goroutinectx@v0.7.5 ./...
frontend-lint:
name: Frontend Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: internal/gui/frontend
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: internal/gui/frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run Biome and svelte-check
run: npm run ci
gui-test:
name: GUI Test (Playwright)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
defaults:
run:
working-directory: internal/gui/frontend
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: internal/gui/frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npm test
- name: Upload Playwright report
uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.os }}
path: internal/gui/frontend/playwright-report/
retention-days: 30
linux-cli-package:
name: Linux CLI Package Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build CLI binary
run: |
CGO_ENABLED=0 go build -o suve-cli ./cmd/suve
file suve-cli
- name: Verify binary runs correctly
run: |
./suve-cli --help
./suve-cli --version
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.41.1
- name: Install lintian and rpmlint
run: |
for i in {1..5}; do sudo apt-get update && break || sleep $((i * 5)); done
for i in {1..5}; do sudo apt-get install -y lintian rpm rpmlint && break || sleep $((i * 5)); done
- name: Generate CLI packages
env:
VERSION: "0.0.0-test"
GOARCH: amd64
run: |
nfpm pkg --config .github/templates/nfpm.yaml --packager deb --target "suve-cli_test_amd64.deb"
nfpm pkg --config .github/templates/nfpm.yaml --packager rpm --target "suve-cli-test.x86_64.rpm"
ls -la *.deb *.rpm
- name: Lint CLI packages
run: |
lintian --tag-display-limit 0 \
--suppress-tags no-changelog,no-manual-page,unknown-field,hardening-no-pie,hardening-no-relro,unstripped-binary-or-object,undeclared-elf-prerequisites,extended-description-contains-empty-paragraph,statically-linked-binary \
"suve-cli_test_amd64.deb"
- name: Test .deb installation
run: |
sudo dpkg -i "suve-cli_test_amd64.deb"
command -v suve
suve --version
suve --help
sudo dpkg -r suve-cli
- name: Test .rpm installation (Fedora container)
run: |
docker run --rm -v "$PWD:/work" -w /work fedora:latest bash -c '
set -e
dnf install -y "./suve-cli-test.x86_64.rpm"
command -v suve
suve --version
suve --help
'
linux-gui-package:
name: Linux GUI Package Test (${{ matrix.arch }}, webkit2gtk-${{ matrix.webkit }})
runs-on: ubuntu-${{ matrix.ubuntu }}${{ matrix.arch == 'arm64' && '-arm' || '' }}
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
webkit: ["4.0", "4.1"]
include:
- arch: amd64
deb_arch: amd64
rpm_arch: x86_64
- arch: arm64
deb_arch: arm64
rpm_arch: aarch64
- webkit: "4.0"
ubuntu: "22.04"
fedora: "39"
webkit_deb: libwebkit2gtk-4.0-37
webkit_rpm: webkit2gtk4.0
pkg_suffix: ""
- webkit: "4.1"
ubuntu: "24.04"
fedora: "latest"
webkit_deb: libwebkit2gtk-4.1-0
webkit_rpm: webkit2gtk4.1
pkg_suffix: "_webkit2_41"
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install build dependencies
run: |
for i in {1..5}; do sudo apt-get update && break || sleep $((i * 5)); done
for i in {1..5}; do sudo apt-get install -y libgtk-3-dev libwebkit2gtk-${{ matrix.webkit }}-dev && break || sleep $((i * 5)); done
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: internal/gui/frontend/package-lock.json
- name: Build frontend
run: |
cd internal/gui/frontend
npm ci
npm run build
- name: Build GUI binary
run: |
TAGS="production"
if [[ "${{ matrix.webkit }}" == "4.1" ]]; then
TAGS="production,webkit2_41"
fi
CGO_ENABLED=1 go build -tags "$TAGS" -o suve ./cmd/suve
file suve
- name: Verify binary runs correctly
run: |
./suve --help | grep -q '\-\-gui' && echo "GUI flag found" || { echo "ERROR: --gui flag missing!"; exit 1; }
./suve --version
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.41.1
- name: Install lintian and rpmlint
run: for i in {1..5}; do sudo apt-get install -y lintian rpm rpmlint && break || sleep $((i * 5)); done
- name: Generate GUI packages
env:
VERSION: "0.0.0-test"
GOARCH: ${{ matrix.arch }}
GTK_DEB: "libgtk-3-0"
GTK_RPM: "gtk3"
WEBKIT_DEB: ${{ matrix.webkit_deb }}
WEBKIT_RPM: ${{ matrix.webkit_rpm }}
run: |
nfpm pkg --config .github/templates/nfpm-gui.yaml --packager deb --target "suve${{ matrix.pkg_suffix }}_test_${{ matrix.deb_arch }}.deb"
nfpm pkg --config .github/templates/nfpm-gui.yaml --packager rpm --target "suve${{ matrix.pkg_suffix }}-test.${{ matrix.rpm_arch }}.rpm"
ls -la *.deb *.rpm
- name: Lint GUI packages
run: |
echo "=== lintian check (.deb) ==="
lintian --tag-display-limit 0 \
--suppress-tags no-changelog,no-manual-page,unknown-field,hardening-no-pie,hardening-no-relro,unstripped-binary-or-object,undeclared-elf-prerequisites,extended-description-contains-empty-paragraph \
"suve${{ matrix.pkg_suffix }}_test_${{ matrix.deb_arch }}.deb"
echo "=== rpmlint check (.rpm) ==="
rpmlint "suve${{ matrix.pkg_suffix }}-test.${{ matrix.rpm_arch }}.rpm" || true
- name: Test .deb installation
run: |
for i in {1..5}; do sudo apt-get update && break || sleep $((i * 5)); done
for i in {1..5}; do sudo apt-get install -y libgtk-3-0 ${{ matrix.webkit_deb }} && break || sleep $((i * 5)); done
sudo dpkg -i "suve${{ matrix.pkg_suffix }}_test_${{ matrix.deb_arch }}.deb"
command -v suve
suve --version
suve --help
sudo dpkg -r suve
- name: Test .rpm installation (Fedora container)
run: |
docker run --rm -v "$PWD:/work" -w /work fedora:${{ matrix.fedora }} bash -c '
set -e
dnf install -y "./suve${{ matrix.pkg_suffix }}-test.${{ matrix.rpm_arch }}.rpm"
command -v suve
suve --version
suve --help
'
gui-test-windows:
name: GUI Test (Playwright) (Windows)
runs-on: windows-latest
if: >-
github.ref == 'refs/heads/main' ||
contains(github.event.head_commit.message, '[CI: windows]')
defaults:
run:
working-directory: internal/gui/frontend
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: internal/gui/frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npm test
- name: Upload Playwright report
uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
with:
name: playwright-report-windows-latest
path: internal/gui/frontend/playwright-report/
retention-days: 30
platform-test:
name: Platform Test (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: linux
runner: ubuntu-latest
- os: darwin
runner: macos-latest
- os: windows
runner: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Find platform-specific packages
id: packages
shell: bash
run: |
# Find packages with platform-specific build tags (excluding gui and test files)
PACKAGES=$(grep -rl "//go:build" --include="*.go" . \
| grep -v "_test.go" \
| grep -v "/gui/" \
| grep -v "vendor" \
| xargs -I{} dirname {} \
| sort -u \
| sed 's|^\./|./|' \
| tr '\n' ' ')
echo "packages=$PACKAGES"
echo "packages=$PACKAGES" >> "$GITHUB_OUTPUT"
- name: Run platform-specific tests with coverage
shell: bash
run: |
COVERPKG=""
for pkg in ${{ steps.packages.outputs.packages }}; do
if [ -n "$COVERPKG" ]; then
COVERPKG="$COVERPKG,"
fi
COVERPKG="$COVERPKG$pkg/..."
done
echo "Coverage packages: $COVERPKG"
go test -v -race -coverprofile=coverage-platform-${{ matrix.os }}.txt -covermode=atomic -coverpkg="$COVERPKG" ${{ steps.packages.outputs.packages }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage-platform-${{ matrix.os }}.txt
flags: platform-${{ matrix.os }}
name: codecov-suve-platform-${{ matrix.os }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
continue-on-error: true
platform-lint:
name: Platform Lint (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: linux
runner: ubuntu-latest
- os: darwin
runner: macos-latest
# Note: Windows excluded due to gci formatter false positives.
# Main Lint job (Linux) covers all essential checks.
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=5m
platform-build:
name: Platform Build (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: freebsd
goarch: amd64
- goos: freebsd
goarch: arm64
- goos: openbsd
goarch: amd64
- goos: netbsd
goarch: amd64
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Find platform-specific packages
id: packages
run: |
# Find packages with platform-specific build tags (excluding gui and test files)
PACKAGES=$(grep -rl "//go:build" --include="*.go" . \
| grep -v "_test.go" \
| grep -v "/gui/" \
| grep -v "vendor" \
| xargs -I{} dirname {} \
| sort -u \
| sed 's|^\./|./|' \
| tr '\n' ' ')
echo "packages=$PACKAGES"
echo "packages=$PACKAGES" >> "$GITHUB_OUTPUT"
- name: Build for ${{ matrix.goos }}/${{ matrix.goarch }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
echo "Building for $GOOS/$GOARCH..."
for pkg in ${{ steps.packages.outputs.packages }}; do
echo "Building $pkg..."
go build -v "$pkg/..."
done
echo "Build successful for $GOOS/$GOARCH"