-
Notifications
You must be signed in to change notification settings - Fork 14
156 lines (126 loc) · 3.61 KB
/
Copy pathci.yml
File metadata and controls
156 lines (126 loc) · 3.61 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.26'
- name: Build
run: CGO_ENABLED=0 go build ./...
- name: Test
run: CGO_ENABLED=0 go test -v ./...
env:
CTX_SKIP_PATH_CHECK: "1"
- name: Vet
run: CGO_ENABLED=0 go vet ./...
dco:
name: DCO
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Get PR commits
id: get-pr-commits
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check DCO sign-off
uses: tim-actions/dco@master
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.26'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
args: --timeout=5m
typecheck-opencode-plugin:
name: Typecheck OpenCode plugin
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: tools/typecheck/opencode/package-lock.json
- name: Install dependencies
working-directory: tools/typecheck/opencode
run: npm ci
- name: Type-check embedded plugin
working-directory: tools/typecheck/opencode
run: npx tsc --noEmit
vscode-extension:
name: VS Code extension build + typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: editors/vscode/package-lock.json
- name: Install dependencies
working-directory: editors/vscode
run: npm ci
- name: Bundle (esbuild)
working-directory: editors/vscode
run: npm run build
- name: Type-check (production + tests)
working-directory: editors/vscode
run: npx tsc --noEmit -p tsconfig.ci.json
- name: Lint (eslint)
working-directory: editors/vscode
run: npm run lint
- name: Test (vitest)
working-directory: editors/vscode
run: npm test
- name: Package dry-run (vsce)
working-directory: editors/vscode
run: npx vsce package --no-dependencies --out /tmp/ctx-extension.vsix
shellcheck:
name: ShellCheck (embedded *.sh)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install shellcheck
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Run shellcheck
run: ./hack/lint-shellcheck.sh
powershell:
name: PSScriptAnalyzer (embedded *.ps1)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install PSScriptAnalyzer
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
- name: Run PSScriptAnalyzer
run: ./hack/lint-powershell.sh