Skip to content

Commit fdd7482

Browse files
authored
Merge pull request #7 from superluminar-io/add-test-workflow
add test and linter workflow
2 parents 24341a5 + 86ba2b4 commit fdd7482

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Run Linter and Tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out source
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js 20
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run linter
27+
run: npm run lint
28+
29+
- name: Run tests
30+
run: npm test
31+
32+
# OPTIONAL: Comment test results on the PR
33+
- name: Comment test status on PR
34+
if: success() || failure()
35+
uses: marocchino/sticky-pull-request-comment@v2
36+
with:
37+
header: test-results
38+
message: |
39+
🚦 **Test run complete**
40+
- Status: ${{ job.status }}
41+
- Commit: `${{ github.sha }}`
42+

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
1212
export default [
1313
// Ignore generated / dependency directories
1414
{
15-
ignores: ['cdk.out', 'node_modules', '**/*.d.ts'],
15+
ignores: ['cdk.out', 'node_modules', '**/*.d.ts', 'dist'],
1616
},
1717
// Base recommended JS rules
1818
js.configs.recommended,

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "budget-alerts",
33
"version": "0.1.0",
44
"bin": {
5-
"budget-alerts": "bin/budget-alerts.js",
6-
"budget-alerts-init-config": "bin/init-budget-config.js"
5+
"budget-alerts": "dist/bin/budget-alerts.js",
6+
"budget-alerts-init-config": "dist/bin/init-budget-config.js"
77
},
88
"scripts": {
99
"build": "tsc",
@@ -15,9 +15,7 @@
1515
"config": "ts-node --transpile-only bin/init-budget-config.ts"
1616
},
1717
"files": [
18-
"bin/*.js",
19-
"lib/**/*.js",
20-
"lib/**/*.d.ts",
18+
"dist/**/*.{js,d.ts}",
2119
"README.md"
2220
],
2321
"devDependencies": {

test/lib/org/budget-planner.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
computeEffectiveBudgets,
55
computeHomogeneousSubtrees,
66
computeOuBudgetAttachments,
7-
OuBudgetAttachment,
87
selectOuBudgetAttachments,
98
validateBudgetConfig,
109
type OuNode,

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"lib": [
77
"es2022"
88
],
9+
"outDir": "dist",
910
"declaration": true,
1011
"strict": true,
1112
"noImplicitAny": true,

0 commit comments

Comments
 (0)