@@ -18,27 +18,31 @@ jobs:
1818 runs-on : ubuntu-latest
1919 steps :
2020 # checkout code
21- - uses : actions/checkout@v2
21+ - name : Checkout
22+ uses : actions/checkout@v3
2223 # install node
2324 - name : Use Node.js 18
24- uses : actions/setup-node@v1
25+ uses : actions/setup-node@v3
2526 with :
2627 node-version : 18
2728 - name : Get cache directory
2829 id : get-cache-directory
2930 run : |
3031 yarn config get cacheFolder
31- echo "::set-output name= path:: $( yarn config get cacheFolder )"
32+ echo "path= $( yarn config get cacheFolder )" >> $GITHUB_OUTPUT
3233 - name : Cache dependencies
33- uses : actions/cache@v2
34+ uses : actions/cache@v3
3435 with :
3536 path : ${{ steps.get-cache-directory.outputs.path }}
3637 key : yarn-cache-packaging-${{ hashFiles('yarn.lock') }}
3738 restore-keys : yarn-cache-packaging-
3839 # lint, build, test
39- - run : yarn install --immutable
40- - run : yarn lint
41- - run : yarn build
40+ - name : Install dependencies
41+ run : yarn install --immutable
42+ - name : Lint
43+ run : yarn lint
44+ - name : Build
45+ run : yarn build
4246 - name : Upload package artifact
4347 uses : actions/upload-artifact@v1
4448 with :
@@ -57,145 +61,88 @@ jobs:
5761 matrix :
5862 os : [ubuntu, windows]
5963 # Don't forget to add all new flavors to this list!
60- flavor : [2, 3, 4, 6, 8, 9, 10, 11 ]
64+ flavor : [1, 2, 3, 4, 5 ]
6165 include :
62- # Node 14.13.0
63- # To test ESM builtin module resolution immediately before a node behavioral change: https://github.com/TypeStrong/ts-node/issues/1130
64- # - flavor: 1
65- # node: 14.13.0
66- # nodeFlag: 14_13_0
67- # typescript: latest
68- # typescriptFlag: latest
69- # Node 14
70- - flavor : 2
71- node : 14
72- nodeFlag : 14
73- typescript : latest
74- typescriptFlag : latest
75- - flavor : 3
76- node : 14
77- nodeFlag : 14
78- typescript : 4.0
79- typescriptFlag : 4_0
80- - flavor : 4
81- node : 14
82- nodeFlag : 14
83- typescript : next
84- typescriptFlag : next
8566 # Node 16
86- # Node 16.11.1
87- # Earliest version that supports old ESM Loader Hooks API: https://github.com/TypeStrong/ts-node/pull/1522
88- # - flavor: 5
89- # node: 16.11.1
90- # nodeFlag: 16_11_1
91- # typescript: latest
92- # typescriptFlag: latest
93- - flavor : 6
67+ - flavor : 1
9468 node : 16
9569 nodeFlag : 16
9670 typescript : latest
9771 typescriptFlag : latest
98- downgradeNpm : true
99- # - flavor: 7
100- # node: 16
101- # nodeFlag: 16
102- # typescript: 4.0
103- # typescriptFlag: 4_0
104- # downgradeNpm: true
105- - flavor : 8
72+ - flavor : 2
10673 node : 16
10774 nodeFlag : 16
108- typescript : next
109- typescriptFlag : next
110- downgradeNpm : true
75+ typescript : 4.2
76+ typescriptFlag : 4_2
11177 # Node 18
112- - flavor : 9
78+ - flavor : 3
11379 node : 18
11480 nodeFlag : 18
11581 typescript : latest
11682 typescriptFlag : latest
117- downgradeNpm : true
118- - flavor : 10
83+ - flavor : 4
11984 node : 18
12085 nodeFlag : 18
12186 typescript : next
12287 typescriptFlag : next
123- downgradeNpm : true
12488 # Node nightly
125- - flavor : 11
126- node : nightly
127- nodeFlag : nightly
89+ - flavor : 5
90+ node : 19- nightly
91+ nodeFlag : 19_nightly
12892 typescript : latest
12993 typescriptFlag : latest
130- downgradeNpm : true
13194 steps :
13295 # checkout code
133- - uses : actions/checkout@v2
96+ - name : Checkout
97+ uses : actions/checkout@v3
13498 # install node
13599 - name : Use Node.js ${{ matrix.node }}
136- if : matrix.node != 'nightly'
137- uses : actions/setup-node@v1
100+ uses : actions/setup-node@v3
138101 with :
139102 node-version : ${{ matrix.node }}
140- - name : Use Node.js 16, will be subsequently overridden by download of nightly
141- if : matrix.node == 'nightly'
142- uses : actions/setup-node@v1
143- with :
144- node-version : 16
145- - name : Download Node.js nightly
146- if : matrix.node == 'nightly' && matrix.os == 'ubuntu'
147- run : |
148- export N_PREFIX=$(pwd)/n
149- npm install -g n
150- n nightly
151- sudo cp "${N_PREFIX}/bin/node" "$(which node)"
152- node --version
153- - name : Download Node.js nightly
154- if : matrix.node == 'nightly' && matrix.os == 'windows'
155- run : |
156- $version = (Invoke-WebRequest https://nodejs.org/download/nightly/index.json | ConvertFrom-json)[0].version
157- $url = "https://nodejs.org/download/nightly/$version/win-x64/node.exe"
158- $targetPath = (Get-Command node.exe).Source
159- Invoke-WebRequest -Uri $url -OutFile $targetPath -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::Chrome)
160- node --version
161103 # lint, build, test
162104 - name : Get cache directory
163105 id : get-cache-directory
164106 run : |
165107 yarn config get cacheFolder
166- echo "::set-output name= path:: $( yarn config get cacheFolder )"
108+ echo "path= $( yarn config get cacheFolder )" >> $GITHUB_OUTPUT
167109 - name : Cache dependencies
168110 if : ${{ matrix.os != 'windows' }}
169- uses : actions/cache@v2
111+ uses : actions/cache@v3
170112 with :
171113 path : ${{ steps.get-cache-directory.outputs.path }}
172114 key : yarn-cache-${{ matrix.os }}-${{ hashFiles('yarn.lock') }}
173115 restore-keys : yarn-cache-${{matrix.os }}-
174- - run : yarn install --immutable --mode=skip-build
175- - name : Upload yarn logs
176- if : ${{ failure() }}
177- uses : actions/upload-artifact@v1
178- with :
179- name : yarn-logs
180- path : yarn-error.log
181- - run : yarn build-tsc
116+ - name : Install dependencies
117+ run : yarn install --immutable --mode=skip-build
118+ - name : Build tests
119+ run : yarn build-tsc
182120 - name : Download package artifact
183121 uses : actions/download-artifact@v1
184122 with :
185123 name : ts-node-packed.tgz
186124 path : tests/
187- - run : yarn add -D typescript@${{ matrix.typescript }}
188- - run : yarn test-cov
189- - name : Upload yarn logs
125+ - name : Install typescript version to test against
126+ run : yarn add -D typescript@${{ matrix.typescript }}
127+ - name : Test
128+ run : yarn test-cov
129+ - name : Check for yarn logs
130+ id : check-yarn-logs-exist
190131 if : ${{ failure() }}
132+ uses : andstor/file-existence-action@v2
133+ with :
134+ files : yarn-error.log
135+ - name : Upload yarn logs
136+ if : ${{ failure() && steps.check-yarn-logs-exist.outputs.files_exists == 'true' }}
191137 uses : actions/upload-artifact@v1
192138 with :
193139 name : yarn-logs-${{ matrix.os }}-node-${{ matrix.nodeFlag }}-typescript-${{ matrix.typescriptFlag }}
194140 path : yarn-error.log
195- - run : yarn coverage-report
141+ - name : Coverage Report
142+ run : yarn coverage-report
196143 if : ${{ always() }}
197144 - name : Codecov
198145 if : ${{ always() }}
199- uses : codecov/codecov-action@v1
146+ uses : codecov/codecov-action@v3
200147 with :
201148 flags : ${{ matrix.os }},node_${{ matrix.nodeFlag }},typescript_${{ matrix.typescriptFlag }}
0 commit comments