Skip to content

Commit 522043a

Browse files
🐛 fix: also npm run test on solutions (#128)
* 🛠 tooling: also npm run test on solutions * Fixed up some packages and tsconfigs
1 parent d4303a3 commit 522043a

File tree

11 files changed

+48
-14
lines changed

11 files changed

+48
-14
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: File Tests
22

33
on:
44
push:

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: "16"
17+
cache: "npm"
18+
- run: npm ci
19+
- name: Get changed files
20+
id: changed-files
21+
uses: tj-actions/changed-files@v22
22+
with:
23+
files: projects
24+
- name: Copy solution files into index files
25+
run: ./scripts/copy-solutions.sh
26+
shell: bash
27+
- name: Run test in project directories
28+
if: ${{ steps.changed-files.outputs.all_changed_files != '' }}
29+
run: ./scripts/changed-solutions.sh ${{ steps.changed-files.outputs.all_changed_files }} "test"
30+
shell: bash
31+
- name: Run test in all project directories
32+
if: ${{ steps.changed-files.outputs.all_changed_files == '' }}
33+
run: ./scripts/check-solutions.sh "test"
34+
shell: bash

.github/workflows/tsc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
if: ${{ steps.changed-files.outputs.all_changed_files != '' }}
2929
run: ./scripts/changed-solutions.sh ${{ steps.changed-files.outputs.all_changed_files }} "tsc"
3030
shell: bash
31-
- name: Run all project tsc
31+
- name: Run tsc in all project directories
3232
if: ${{ steps.changed-files.outputs.all_changed_files == '' }}
3333
run: ./scripts/check-solutions.sh "tsc"
3434
shell: bash

projects/type-operations/array-type-shenanigans/01-flat-filter/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}

projects/type-operations/array-type-shenanigans/02-reverse/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}

projects/type-operations/array-type-shenanigans/03-zip/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "array-type-shenanigans",
33
"scripts": {
4-
"test": "tsc",
5-
"test:solutions": "tsc -p ./tsconfig.test.json",
6-
"tsc": "tsc"
4+
"test": "tsc -b",
5+
"test:solutions": "tsc -b ./tsconfig.test.json",
6+
"tsc": "tsc -b"
77
}
88
}

projects/type-operations/template-literal-type-shenanigans/01-spongecase/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}

projects/type-operations/template-literal-type-shenanigans/02-word-replace/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}

projects/type-operations/template-literal-type-shenanigans/03-split-on/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"~/index": ["./solution.ts"]
66
}
77
},
8-
"include": ["./index.test.ts"]
8+
"include": ["./index.test.ts", "./solution.ts"]
99
}

0 commit comments

Comments
 (0)