chore(deps): bump Go modules + fix flaky frontend tests #194
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26.x" | |
| cache: true | |
| - name: Set up MSVC for Windows | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| cache-dependency-path: cmd/opsforall-gui/frontend/package-lock.json | |
| - name: Install Wails CLI (pinned to v2 — matches go.mod; @latest drifts to v3) | |
| run: | | |
| go install github.com/wailsapp/wails/v2/cmd/wails@v2.13.0 | |
| echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| shell: bash | |
| - name: Install golangci-lint (pinned v1.x — .golangci.yml is v1 config; @latest is now v2) | |
| run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 | |
| shell: bash | |
| - name: Create placeholder for embed | |
| run: | | |
| mkdir -p cmd/opsforall-gui/frontend/dist | |
| touch cmd/opsforall-gui/frontend/dist/index.html | |
| shell: bash | |
| - name: Generate Wails TypeScript bindings | |
| run: wails generate module | |
| shell: bash | |
| - name: Install frontend dependencies | |
| run: cd cmd/opsforall-gui/frontend && npm ci | |
| shell: bash | |
| - name: Build frontend | |
| run: cd cmd/opsforall-gui/frontend && npm run build | |
| shell: bash | |
| - name: Vet | |
| run: go vet ./... | |
| shell: bash | |
| - name: Run golangci-lint | |
| run: golangci-lint run --timeout=10m | |
| shell: bash | |
| - name: Go test | |
| run: go test ./internal/... -coverprofile=coverage.out -covermode=atomic -count=1 | |
| shell: bash | |
| - name: TypeScript check | |
| # tsc -b (build mode) — the root tsconfig is project-references only, so | |
| # plain `tsc --noEmit` type-checks nothing. -b matches `npm run build`. | |
| run: cd cmd/opsforall-gui/frontend && npx tsc -b | |
| shell: bash | |
| - name: Frontend test | |
| run: cd cmd/opsforall-gui/frontend && npx vitest run --coverage | |
| shell: bash | |
| - name: Build app for E2E tests | |
| run: wails build -platform windows/amd64 -o universal-ops.exe | |
| shell: bash | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: pip install pytest pywinauto | |
| shell: bash | |
| - name: E2E tests | |
| run: python run_e2e_tests.py | |
| shell: bash | |
| env: | |
| APP_PATH: ${{ github.workspace }}/build/bin/universal-ops.exe | |
| E2E_ENABLE_UIA_DOM: "1" | |
| continue-on-error: true | |
| - name: npm audit | |
| run: cd cmd/opsforall-gui/frontend && npm audit --audit-level=high | |
| shell: bash | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.out,./cmd/opsforall-gui/frontend/coverage/lcov.info | |
| flags: unittests | |
| verbose: true | |
| - name: Archive test results on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| coverage.out | |
| cmd/opsforall-gui/frontend/coverage/ | |
| retention-days: 7 |