Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update GitHub Actions #1144

Merged
merged 18 commits into from
Jul 16, 2020
19 changes: 0 additions & 19 deletions .github/node-chrome/Dockerfile

This file was deleted.

87 changes: 77 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,96 @@
on: [push, pull_request]
name: CI

name: build and test
on: [push, pull_request]

jobs:
build_and_test:
comparison_test:
name: Comparison Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: install
run: yarn install

- name: build
run: yarn build

- name: install typescript
run: yarn add [email protected]

- name: test
run: sudo yarn comparison-tests

windows:
name: Windows Test
runs-on: windows-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v2

- name: copy files
shell: pwsh
run: |
New-Item C:\source\ts-loader -ItemType Directory
Copy-Item .\* C:\source\ts-loader -Recurse -Force

- name: install
run: yarn install
working-directory: C:\source\ts-loader

- name: build
run: yarn build
working-directory: C:\source\ts-loader

- name: install typescript
run: yarn add [email protected]
working-directory: C:\source\ts-loader

- name: test
run: yarn comparison-tests
working-directory: C:\source\ts-loader

execution_test:
name: Execution Test
strategy:
matrix:
os: [ubuntu]
node: [10, 12, 14]
ts: [3.6.5, 3.7.5, 3.8.3, 3.9.3, next]
include:
- os: windows
node: 14
ts: 3.9.3
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2

- name: install node
uses: actions/setup-node@v1
with:
node-version: 12

- name: upgrade yarn
run: npm install yarn -g
node-version: ${{ matrix.node }}

- name: install
run: yarn install

- name: build
run: yarn build

- name: install chrome
uses: ./.github/node-chrome
- name: install typescript
run: yarn add typescript@${{ matrix.ts }}

- name: test
run: yarn execution-tests

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: install
run: yarn install

- name: lint
run: yarn lint
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ env:
- [email protected]
- [email protected]
- [email protected]

2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
- TYPESCRIPT: [email protected]
- TYPESCRIPT: [email protected]
- TYPESCRIPT: [email protected]

install:
- ps: Install-Product node $env:nodejs_version
- yarn install
Expand Down
22 changes: 11 additions & 11 deletions test/comparison-tests/create-and-execute-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ if (fs.statSync(testPath).isDirectory() &&

/**
* Create a Jasmine test
* @param {string} test
* @param {string} testPath
* @param {any} options
* @param {string} test
* @param {string} testPath
* @param {any} options
*/
function createTest(test, testPath, options) {
return function (done) {
Expand Down Expand Up @@ -177,7 +177,7 @@ function createWebpackConfig(paths, optionsOriginal, useWatchApi) {

const tsLoaderPath = path.join(__dirname, "../../index.js");
aliasLoader(config, tsLoaderPath, options);

config.context = paths.outputPath;
paths.outputPath = config.output.path = config.output.path || paths.outputPath;
config.resolveLoader = config.resolveLoader || {};
Expand Down Expand Up @@ -401,11 +401,11 @@ function getNormalisedFileContent(file, location) {
return 'at ' + remainingPathAndColon + 'irrelevant-line-number' + colon + 'irrelevant-column-number';
})
// strip C:/projects/ts-loader/.test/
.replace(/(C\:\/)?[\w|\/]*\/(ts-loader|workspace)\/\.test/ig, '')
.replace(/webpack:\/\/(C:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'webpack://comparison-tests/')
.replace(/WEBPACK FOOTER\/n\/ (C:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/')
.replace(/!\** (C\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '!*** /ts-loader/test/comparison-tests/')
.replace(/\/ (C\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '/ /ts-loader/test/comparison-tests/')
.replace(/([a-zA-Z]\:\/)?[\w|\/]*\/(ts-(loader)?|workspace)\/\.test/ig, '')
.replace(/webpack:\/\/([a-zA-Z]:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'webpack://comparison-tests/')
.replace(/WEBPACK FOOTER\/n\/ ([a-zA-Z]:\/)?[\w|\/|-]*\/comparison-tests\//ig, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/')
.replace(/!\** ([a-zA-Z]\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '!*** /ts-loader/test/comparison-tests/')
.replace(/\/ ([a-zA-Z]\:\/)?[\w|\/|-]*\/comparison-tests\//ig, '/ /ts-loader/test/comparison-tests/')
// with webpack 4 there are different numbers of *s on Windows and on Linux
.replace(/\*{10}\**/g, '**********');
} catch (e) {
Expand All @@ -425,9 +425,9 @@ function normaliseString(platformSpecificContent) {
.replace(new RegExp(regexEscape('\\'), 'g'), '/')
.replace(new RegExp(regexEscape('//'), 'g'), '/')
// replace C:/source/ts-loader/index.js or /home/travis/build/TypeStrong/ts-loader/index.js with ts-loader
.replace(/ \S+[\/|\\](ts-loader|workspace)[\/|\\]index.js/g, 'ts-loader')
.replace(/ \S+[\/|\\](ts-(loader)?|workspace)[\/|\\]index.js/g, 'ts-loader')
// replace (C:/source/ts-loader/dist/index.js with (ts-loader)
.replace(/\(\S+[\/|\\](ts-loader|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
.replace(/\(\S+[\/|\\](ts-(loader)?|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/comparison-tests/run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function runTestAsChildProcess(testName) {
const testToRun = ' --test-to-run ' + testName;
const debug = process.argv.indexOf('--debug') > -1;
const testCommand =
'mocha --reporter spec ' +
'mocha -c --reporter spec ' +
(debug ? '--inspect-brk=5858 ' : '') +
'test/comparison-tests/create-and-execute-test.js ' +
testToRun;
Expand Down