Skip to content

Commit 74bf400

Browse files
authored
update GitHub Actions (#1144)
* update GitHub Actions * fix config file * defer typescript installation * add timeout limitation * force color for mocha * fix typescript version * increase timeout limitation * increase timeout limitation * fix compatibility issue * tweak CI * attempt to fix * tweak * tweak and try * tweak CI * clean up * tweak CI * fix * revert deletion
1 parent abae5fd commit 74bf400

6 files changed

Lines changed: 90 additions & 43 deletions

File tree

.github/node-chrome/Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,96 @@
1-
on: [push, pull_request]
1+
name: CI
22

3-
name: build and test
3+
on: [push, pull_request]
44

55
jobs:
6-
build_and_test:
6+
comparison_test:
7+
name: Comparison Test
78
runs-on: ubuntu-latest
9+
timeout-minutes: 15
810
steps:
9-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v2
12+
13+
- name: install
14+
run: yarn install
15+
16+
- name: build
17+
run: yarn build
18+
19+
- name: install typescript
20+
run: yarn add typescript@3.9.3
21+
22+
- name: test
23+
run: sudo yarn comparison-tests
24+
25+
windows:
26+
name: Windows Test
27+
runs-on: windows-latest
28+
timeout-minutes: 25
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: copy files
33+
shell: pwsh
34+
run: |
35+
New-Item C:\source\ts-loader -ItemType Directory
36+
Copy-Item .\* C:\source\ts-loader -Recurse -Force
37+
38+
- name: install
39+
run: yarn install
40+
working-directory: C:\source\ts-loader
41+
42+
- name: build
43+
run: yarn build
44+
working-directory: C:\source\ts-loader
45+
46+
- name: install typescript
47+
run: yarn add typescript@3.9.3
48+
working-directory: C:\source\ts-loader
49+
50+
- name: test
51+
run: yarn comparison-tests
52+
working-directory: C:\source\ts-loader
53+
54+
execution_test:
55+
name: Execution Test
56+
strategy:
57+
matrix:
58+
os: [ubuntu]
59+
node: [10, 12, 14]
60+
ts: [3.6.5, 3.7.5, 3.8.3, 3.9.3, next]
61+
include:
62+
- os: windows
63+
node: 14
64+
ts: 3.9.3
65+
runs-on: ${{ matrix.os }}-latest
66+
steps:
67+
- uses: actions/checkout@v2
1068

1169
- name: install node
1270
uses: actions/setup-node@v1
1371
with:
14-
node-version: 12
15-
16-
- name: upgrade yarn
17-
run: npm install yarn -g
72+
node-version: ${{ matrix.node }}
1873

1974
- name: install
2075
run: yarn install
2176

2277
- name: build
2378
run: yarn build
2479

25-
- name: install chrome
26-
uses: ./.github/node-chrome
80+
- name: install typescript
81+
run: yarn add typescript@${{ matrix.ts }}
2782

2883
- name: test
2984
run: yarn execution-tests
85+
86+
lint:
87+
name: Lint
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v2
91+
92+
- name: install
93+
run: yarn install
94+
95+
- name: lint
96+
run: yarn lint

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ env:
1919
- TYPESCRIPT=typescript@3.8.2
2020
- TYPESCRIPT=typescript@3.7.4
2121
- TYPESCRIPT=typescript@3.6.3
22-

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
- TYPESCRIPT: typescript@3.8.2
99
- TYPESCRIPT: typescript@3.7.4
1010
- TYPESCRIPT: typescript@3.6.3
11-
11+
1212
install:
1313
- ps: Install-Product node $env:nodejs_version
1414
- yarn install

test/comparison-tests/create-and-execute-test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ if (fs.statSync(testPath).isDirectory() &&
6868

6969
/**
7070
* Create a Jasmine test
71-
* @param {string} test
72-
* @param {string} testPath
73-
* @param {any} options
71+
* @param {string} test
72+
* @param {string} testPath
73+
* @param {any} options
7474
*/
7575
function createTest(test, testPath, options) {
7676
return function (done) {
@@ -177,7 +177,7 @@ function createWebpackConfig(paths, optionsOriginal, useWatchApi) {
177177

178178
const tsLoaderPath = path.join(__dirname, "../../index.js");
179179
aliasLoader(config, tsLoaderPath, options);
180-
180+
181181
config.context = paths.outputPath;
182182
paths.outputPath = config.output.path = config.output.path || paths.outputPath;
183183
config.resolveLoader = config.resolveLoader || {};
@@ -401,11 +401,11 @@ function getNormalisedFileContent(file, location) {
401401
return 'at ' + remainingPathAndColon + 'irrelevant-line-number' + colon + 'irrelevant-column-number';
402402
})
403403
// strip C:/projects/ts-loader/.test/
404-
.replace(/(C\:\/)?[\w|\/]*\/(ts-loader|workspace)\/\.test/ig, '')
405-
.replace(/webpack:\/\/(C:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'webpack://comparison-tests/')
406-
.replace(/WEBPACK FOOTER\/n\/ (C:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/')
407-
.replace(/!\** (C\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '!*** /ts-loader/test/comparison-tests/')
408-
.replace(/\/ (C\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '/ /ts-loader/test/comparison-tests/')
404+
.replace(/([a-zA-Z]\:\/)?[\w|\/]*\/(ts-(loader)?|workspace)\/\.test/ig, '')
405+
.replace(/webpack:\/\/([a-zA-Z]:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'webpack://comparison-tests/')
406+
.replace(/WEBPACK FOOTER\/n\/ ([a-zA-Z]:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/')
407+
.replace(/!\** ([a-zA-Z]\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '!*** /ts-loader/test/comparison-tests/')
408+
.replace(/\/ ([a-zA-Z]\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '/ /ts-loader/test/comparison-tests/')
409409
// with webpack 4 there are different numbers of *s on Windows and on Linux
410410
.replace(/\*{10}\**/g, '**********');
411411
} catch (e) {
@@ -425,9 +425,9 @@ function normaliseString(platformSpecificContent) {
425425
.replace(new RegExp(regexEscape('\\'), 'g'), '/')
426426
.replace(new RegExp(regexEscape('//'), 'g'), '/')
427427
// replace C:/source/ts-loader/index.js or /home/travis/build/TypeStrong/ts-loader/index.js with ts-loader
428-
.replace(/ \S+[\/|\\](ts-loader|workspace)[\/|\\]index.js/g, 'ts-loader')
428+
.replace(/ \S+[\/|\\](ts-(loader)?|workspace)[\/|\\]index.js/g, 'ts-loader')
429429
// replace (C:/source/ts-loader/dist/index.js with (ts-loader)
430-
.replace(/\(\S+[\/|\\](ts-loader|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
430+
.replace(/\(\S+[\/|\\](ts-(loader)?|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
431431
}
432432

433433
/**

test/comparison-tests/run-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function runTestAsChildProcess(testName) {
182182
const testToRun = ' --test-to-run ' + testName;
183183
const debug = process.argv.indexOf('--debug') > -1;
184184
const testCommand =
185-
'mocha --reporter spec ' +
185+
'mocha -c --reporter spec ' +
186186
(debug ? '--inspect-brk=5858 ' : '') +
187187
'test/comparison-tests/create-and-execute-test.js ' +
188188
testToRun;

0 commit comments

Comments
 (0)