-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (103 loc) · 3.53 KB
/
Copy pathtest.yml
File metadata and controls
127 lines (103 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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