Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PR Tests

on:
pull_request:
branches:
- main

jobs:
test:
name: Run Linter and Tests
runs-on: ubuntu-latest

steps:
- name: Check out source
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test

# OPTIONAL: Comment test results on the PR
- name: Comment test status on PR
if: success() || failure()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: test-results
message: |
🚦 **Test run complete**
- Status: ${{ job.status }}
- Commit: `${{ github.sha }}`

2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
export default [
// Ignore generated / dependency directories
{
ignores: ['cdk.out', 'node_modules', '**/*.d.ts'],
ignores: ['cdk.out', 'node_modules', '**/*.d.ts', 'dist'],
},
// Base recommended JS rules
js.configs.recommended,
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "budget-alerts",
"version": "0.1.0",
"bin": {
"budget-alerts": "bin/budget-alerts.js",
"budget-alerts-init-config": "bin/init-budget-config.js"
"budget-alerts": "dist/bin/budget-alerts.js",
"budget-alerts-init-config": "dist/bin/init-budget-config.js"
},
"scripts": {
"build": "tsc",
Expand All @@ -15,9 +15,7 @@
"config": "ts-node --transpile-only bin/init-budget-config.ts"
},
"files": [
"bin/*.js",
"lib/**/*.js",
"lib/**/*.d.ts",
"dist/**/*.{js,d.ts}",
"README.md"
],
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion test/lib/org/budget-planner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
computeEffectiveBudgets,
computeHomogeneousSubtrees,
computeOuBudgetAttachments,
OuBudgetAttachment,
selectOuBudgetAttachments,
validateBudgetConfig,
type OuNode,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"lib": [
"es2022"
],
"outDir": "dist",
"declaration": true,
"strict": true,
"noImplicitAny": true,
Expand Down