Skip to content

Commit 59b40ce

Browse files
authored
Merge pull request #47 from theodevelop/chore/ci-workflow
chore: consolidate CI workflows and add full test suite
2 parents 22efb87 + 5aa2955 commit 59b40ce

4 files changed

Lines changed: 51 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: ["main", "dev"]
66
pull_request:
77
branches: ["main", "dev"]
8+
workflow_dispatch:
89

910
jobs:
1011
build-and-test:
@@ -25,9 +26,24 @@ jobs:
2526
- name: Compile
2627
run: npm run compile
2728

28-
- name: Run parser tests
29+
- name: Test — parsers
2930
run: npx ts-node --project server/tsconfig.json tests/test-parsers.ts
3031

32+
- name: Test — diagnostic codes
33+
run: TS_NODE_PROJECT=tsconfig.base.json npx ts-node tests/test-diagnostic-codes.ts
34+
35+
- name: Test — version settings
36+
run: TS_NODE_PROJECT=tsconfig.base.json npx ts-node tests/test-version-settings.ts
37+
38+
- name: Test — fix-it hints (code actions)
39+
run: TS_NODE_PROJECT=tsconfig.base.json npx ts-node tests/test-fix-it-hints.ts
40+
41+
- name: Test — line directive utils
42+
run: TS_NODE_PROJECT=tsconfig.base.json npx ts-node tests/test-line-directive.ts
43+
44+
- name: Test — new providers
45+
run: TS_NODE_PROJECT=tsconfig.base.json npx ts-node tests/test-new-providers.ts
46+
3147
- name: Package VSIX
3248
run: npx vsce package --no-dependencies -o extension.vsix
3349

.github/workflows/publish-ovsx.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ on:
66
- "v*"
77

88
jobs:
9-
package:
9+
release:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
1313

1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Verify tag is on main
20+
run: |
21+
git fetch origin main
22+
if ! git merge-base --is-ancestor HEAD origin/main; then
23+
echo "❌ Release tags must be created from the main branch."
24+
exit 1
25+
fi
1626
1727
- name: Setup Node.js
1828
uses: actions/setup-node@v4
@@ -24,12 +34,30 @@ jobs:
2434
run: npm ci
2535

2636
- name: Build VSIX
27-
run: |
28-
npm run package
29-
npx vsce package
37+
run: npx vsce package
3038

3139
- name: Create GitHub Release
3240
uses: softprops/action-gh-release@v2
3341
with:
3442
files: "*.vsix"
35-
generate_release_notes: true
43+
generate_release_notes: true
44+
45+
- name: Publish to Open VSX
46+
env:
47+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
48+
run: |
49+
if [ -z "$OVSX_PAT" ]; then
50+
echo "⚠️ OVSX_PAT not set — skipping Open VSX publish"
51+
else
52+
npx ovsx publish *.vsix --pat "$OVSX_PAT"
53+
fi
54+
55+
- name: Publish to VS Marketplace
56+
env:
57+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
58+
run: |
59+
if [ -z "$VSCE_PAT" ]; then
60+
echo "⚠️ VSCE_PAT not set — skipping VS Marketplace publish"
61+
else
62+
npx vsce publish --pat "$VSCE_PAT"
63+
fi

tests/test-new-providers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ const fakeDiag: Diagnostic = {
213213
range: Range.create(3, 10, 3, 19),
214214
message: `Token 'UNDECLARED' is used but not declared with %token.`,
215215
source: 'bison',
216+
code: 'bison/undeclared-token',
216217
};
217218

218219
const caParams: CodeActionParams = {

0 commit comments

Comments
 (0)