@@ -18,27 +18,31 @@ jobs:
18
18
runs-on : ubuntu-latest
19
19
steps :
20
20
# checkout code
21
- - uses : actions/checkout@v2
21
+ - name : Checkout
22
+ uses : actions/checkout@v3
22
23
# install node
23
24
- name : Use Node.js 18
24
- uses : actions/setup-node@v1
25
+ uses : actions/setup-node@v3
25
26
with :
26
27
node-version : 18
27
28
- name : Get cache directory
28
29
id : get-cache-directory
29
30
run : |
30
31
yarn config get cacheFolder
31
- echo "::set-output name= path:: $( yarn config get cacheFolder )"
32
+ echo "path= $( yarn config get cacheFolder )" >> $GITHUB_OUTPUT
32
33
- name : Cache dependencies
33
- uses : actions/cache@v2
34
+ uses : actions/cache@v3
34
35
with :
35
36
path : ${{ steps.get-cache-directory.outputs.path }}
36
37
key : yarn-cache-packaging-${{ hashFiles('yarn.lock') }}
37
38
restore-keys : yarn-cache-packaging-
38
39
# 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
42
46
- name : Upload package artifact
43
47
uses : actions/upload-artifact@v1
44
48
with :
@@ -57,145 +61,88 @@ jobs:
57
61
matrix :
58
62
os : [ubuntu, windows]
59
63
# 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 ]
61
65
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
85
66
# 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
94
68
node : 16
95
69
nodeFlag : 16
96
70
typescript : latest
97
71
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
106
73
node : 16
107
74
nodeFlag : 16
108
- typescript : next
109
- typescriptFlag : next
110
- downgradeNpm : true
75
+ typescript : 4.2
76
+ typescriptFlag : 4_2
111
77
# Node 18
112
- - flavor : 9
78
+ - flavor : 3
113
79
node : 18
114
80
nodeFlag : 18
115
81
typescript : latest
116
82
typescriptFlag : latest
117
- downgradeNpm : true
118
- - flavor : 10
83
+ - flavor : 4
119
84
node : 18
120
85
nodeFlag : 18
121
86
typescript : next
122
87
typescriptFlag : next
123
- downgradeNpm : true
124
88
# Node nightly
125
- - flavor : 11
126
- node : nightly
127
- nodeFlag : nightly
89
+ - flavor : 5
90
+ node : 19- nightly
91
+ nodeFlag : 19_nightly
128
92
typescript : latest
129
93
typescriptFlag : latest
130
- downgradeNpm : true
131
94
steps :
132
95
# checkout code
133
- - uses : actions/checkout@v2
96
+ - name : Checkout
97
+ uses : actions/checkout@v3
134
98
# install node
135
99
- name : Use Node.js ${{ matrix.node }}
136
- if : matrix.node != 'nightly'
137
- uses : actions/setup-node@v1
100
+ uses : actions/setup-node@v3
138
101
with :
139
102
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
161
103
# lint, build, test
162
104
- name : Get cache directory
163
105
id : get-cache-directory
164
106
run : |
165
107
yarn config get cacheFolder
166
- echo "::set-output name= path:: $( yarn config get cacheFolder )"
108
+ echo "path= $( yarn config get cacheFolder )" >> $GITHUB_OUTPUT
167
109
- name : Cache dependencies
168
110
if : ${{ matrix.os != 'windows' }}
169
- uses : actions/cache@v2
111
+ uses : actions/cache@v3
170
112
with :
171
113
path : ${{ steps.get-cache-directory.outputs.path }}
172
114
key : yarn-cache-${{ matrix.os }}-${{ hashFiles('yarn.lock') }}
173
115
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
182
120
- name : Download package artifact
183
121
uses : actions/download-artifact@v1
184
122
with :
185
123
name : ts-node-packed.tgz
186
124
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
190
131
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' }}
191
137
uses : actions/upload-artifact@v1
192
138
with :
193
139
name : yarn-logs-${{ matrix.os }}-node-${{ matrix.nodeFlag }}-typescript-${{ matrix.typescriptFlag }}
194
140
path : yarn-error.log
195
- - run : yarn coverage-report
141
+ - name : Coverage Report
142
+ run : yarn coverage-report
196
143
if : ${{ always() }}
197
144
- name : Codecov
198
145
if : ${{ always() }}
199
- uses : codecov/codecov-action@v1
146
+ uses : codecov/codecov-action@v3
200
147
with :
201
148
flags : ${{ matrix.os }},node_${{ matrix.nodeFlag }},typescript_${{ matrix.typescriptFlag }}
0 commit comments