-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (94 loc) · 2.95 KB
/
Copy pathcode-quality.yml
File metadata and controls
116 lines (94 loc) · 2.95 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
name: Code Quality
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: code-quality-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: windows-latest
timeout-minutes: 45
env:
GOCACHE: ${{ github.workspace }}\.cache\go-build
defaults:
run:
shell: pwsh
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
# GH_PAT must be a PAT (classic or fine-grained) with read access to
# all private submodule repos in the Command-IDE org. The default
# GITHUB_TOKEN is scoped to this repo only and cannot clone private
# submodules owned by the same organisation.
token: ${{ secrets.GH_PAT || github.token }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: app/go.mod
cache-dependency-path: app/go.sum
- name: Install app frontend dependencies
run: npm.cmd ci
working-directory: app/frontend
- name: Install installer frontend dependencies
run: npm.cmd ci
working-directory: installer/frontend
- name: Build app frontend
run: npm.cmd run build
working-directory: app/frontend
- name: Build installer frontend
run: npm.cmd run build
working-directory: installer/frontend
- name: Check Go formatting
run: |
$goFiles = git ls-files '*.go'
if (-not $goFiles) {
exit 0
}
$unformatted = @(
$goFiles |
ForEach-Object { gofmt -l $_ } |
Where-Object { $_ }
)
if ($unformatted.Count -gt 0) {
Write-Host 'These Go files need gofmt:'
$unformatted | ForEach-Object { Write-Host $_ }
exit 1
}
- name: Test app Go module
run: go test ./...
working-directory: app
- name: Vet app Go module
run: go vet ./...
working-directory: app
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@v2.12.0
$goBin = Join-Path (go env GOPATH) 'bin'
$goBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run full Windows package build
run: ./build.ps1
- name: Verify build outputs
run: |
$expected = @(
'app\build\bin\cmdIDE-windows-amd64.exe',
'app\build\bin\cmdIDE-plugins-windows-amd64.exe',
'app\build\bin\cmdIDE-installer-windows.exe'
)
foreach ($path in $expected) {
if (-not (Test-Path $path)) {
throw "Missing expected build output: $path"
}
}