Skip to content
Open
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
78 changes: 71 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
test_type: [unit, integration, e2e]
include:
- os: windows-latest
test_type: platform_specific
- os: macos-latest
test_type: platform_specific
- os: ubuntu-latest
test_type: platform_specific
fail-fast: false

steps:
Expand Down Expand Up @@ -97,23 +105,69 @@ jobs:
with:
run: |
echo "Running visual tests with virtual display..."
go test -v -timeout=120s ./tests/visual/...
go test -v -timeout=120s -tags=gui ./tests/visual/...
options: "-screen 0 1920x1080x24"

- name: Run visual tests (macOS)
if: matrix.os == 'macos-latest'
shell: bash
run: |
echo "Running visual tests on macOS with native display..."
go test -v -timeout=120s ./tests/visual/...
go test -v -timeout=120s -tags=gui ./tests/visual/...

- name: Run visual tests (Windows - Limited)
- name: Run visual tests (Windows - Fallback)
if: matrix.os == 'windows-latest'
shell: bash
run: |
echo "Running non-GUI visual tests on Windows..."
# Run only tests that don't require screenshot capture
go test -v -timeout=60s ./tests/visual/... -run="Test.*Architecture|Test.*Performance|Test.*Artifact.*Generation" || echo "Some visual tests skipped on Windows"
echo "Running fallback visual tests on Windows..."
# Run visual tests with fallback implementations (no GUI tag)
go test -v -timeout=60s ./tests/visual/...

- name: Run E2E tests
shell: bash
run: |
echo "Running E2E tests on ${{ matrix.os }}..."
if [ "${{ matrix.test_type }}" == "e2e" ] || [ "${{ matrix.test_type }}" == "platform_specific" ]; then
# Set recording environment for E2E tests
export E2E_RECORDING=false
if [ "$RUNNER_OS" == "Windows" ]; then
go test -v -timeout=180s ./tests/e2e/...
else
go test -v -timeout=180s -parallel=2 ./tests/e2e/...
fi
else
echo "Skipping E2E tests for test_type: ${{ matrix.test_type }}"
fi

- name: Run cross-platform tests
shell: bash
run: |
echo "Running cross-platform tests on ${{ matrix.os }}..."
if [ "${{ matrix.test_type }}" == "platform_specific" ]; then
if [ "$RUNNER_OS" == "Windows" ]; then
go test -v -timeout=120s ./tests/cross_platform/...
else
go test -v -timeout=120s -parallel=2 ./tests/cross_platform/...
fi
else
echo "Skipping cross-platform tests for test_type: ${{ matrix.test_type }}"
fi

- name: Run recording tests
shell: bash
run: |
echo "Running recording tests on ${{ matrix.os }}..."
if [ "${{ matrix.test_type }}" == "e2e" ]; then
# Enable recording for these tests
export E2E_RECORDING=true
if [ "$RUNNER_OS" == "Windows" ]; then
go test -v -timeout=90s ./tests/recording/...
else
go test -v -timeout=90s -parallel=2 ./tests/recording/...
fi
else
echo "Skipping recording tests for test_type: ${{ matrix.test_type }}"
fi

- name: Generate coverage
shell: bash
Expand Down Expand Up @@ -156,11 +210,21 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
name: test-results-${{ matrix.os }}-${{ matrix.test_type }}
path: |
tests/artifacts/
retention-days: 30

- name: Upload E2E test artifacts
uses: actions/upload-artifact@v4
if: always() && (matrix.test_type == 'e2e' || matrix.test_type == 'platform_specific')
with:
name: e2e-test-artifacts-${{ matrix.os }}-${{ matrix.test_type }}
path: |
tests/artifacts/recordings/
tests/artifacts/e2e_reports/
retention-days: 7

- name: Upload visual test artifacts (Linux)
uses: actions/upload-artifact@v4
if: always() && matrix.os == 'ubuntu-latest'
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/dmisiuk/acousticalc

go 1.25.1
go 1.24.0

toolchain go1.24.7

require (
github.com/disintegration/imaging v1.6.2
Expand Down
2 changes: 2 additions & 0 deletions pkg/calculator/calculator_visual_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build gui && (linux || darwin)

package calculator

import (
Expand Down
Loading
Loading