Skip to content

release event not available so use push event and filter #893

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

Merged
merged 31 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
09fe1ed
release event not available so use push event and filter
johnnyreilly Jan 5, 2019
a1f517f
use @master in place of @1.0.0
johnnyreilly Jan 5, 2019
18cf41e
check for a new tag last
johnnyreilly Jan 5, 2019
e8340e5
Try using docker://zenika/alpine-chrome:with-node
johnnyreilly Jan 5, 2019
e13ee80
Can use yarn
johnnyreilly Jan 5, 2019
1b9d636
Just run execution tests
johnnyreilly Jan 5, 2019
915caaa
Use node 10 docker image and run all tests
johnnyreilly Jan 5, 2019
7841e07
Comment tests until they are dockerised
johnnyreilly Jan 5, 2019
3c1fcc0
Run execution tests again
johnnyreilly Jan 5, 2019
5507c28
Don't install pnpm globally
johnnyreilly Jan 5, 2019
4816b95
Use npx to run pnpm
johnnyreilly Jan 5, 2019
8d0f21a
Run Chrome no sandbox
johnnyreilly Jan 5, 2019
58a2b67
More --no-sandbox
johnnyreilly Jan 5, 2019
a085064
create own dockerfile with node / chrome headless
johnnyreilly Jan 5, 2019
be59bf8
common karma.conf.js using ChromeHeadless --no-sandbox
johnnyreilly Jan 5, 2019
8efb10c
no sandbox on command line
johnnyreilly Jan 5, 2019
e3f7395
use alpine-chrome:with-node docker image
johnnyreilly Jan 5, 2019
5cb183e
back to the version that works
johnnyreilly Jan 5, 2019
17ad002
drop node 6 from travis
johnnyreilly Jan 5, 2019
e03d27b
try using node:10-slim
johnnyreilly Jan 6, 2019
1a55f40
start building and running in docker
johnnyreilly Jan 6, 2019
a4fc243
use full node image instead of slim for comparison tests
johnnyreilly Jan 6, 2019
1dd8f94
set GITHUB_WORKSPACE = "/github/workspace/ts-loader"
johnnyreilly Jan 6, 2019
e2a2a8e
close to being able to run comparison tests in docker container
johnnyreilly Jan 6, 2019
f3dbf67
left a stray
johnnyreilly Jan 6, 2019
9d230a3
tests pass in docker
johnnyreilly Jan 6, 2019
5e19487
can comparison tests pass in a GitHub Action?
johnnyreilly Jan 6, 2019
e927275
comparison tests will not pass in github action
johnnyreilly Jan 7, 2019
b38f734
add docker:build step to package.json
johnnyreilly Jan 7, 2019
6ed74ce
Exclude npm publishing until https://github.com/actions/bin/issues/13…
johnnyreilly Jan 8, 2019
9a1362f
Update main.workflow
johnnyreilly Jan 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.github
.vscode
.test
node_modules
examples
26 changes: 17 additions & 9 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
workflow "build, test and publish on release" {
on = "release"
resolves = "publish"
on = "push"
# resolves = "publish" - commented until this issue is resolved: https://github.com/actions/bin/issues/13
resolves = "check for new tag"
}

# install with yarn
Expand All @@ -21,15 +22,22 @@ action "build" {
# test with yarn
action "test" {
needs = "build"
uses = "actions/[email protected]"
uses = "./.github/node-chrome"
runs = "yarn"
args = "test"
args = "execution-tests"
}

# publish with npm
action "publish" {
# filter for a new tag
action "check for new tag" {
needs = "test"
uses = "actions/[email protected]"
args = "publish"
secrets = ["NPM_AUTH_TOKEN"]
uses = "actions/bin/filter@master"
args = "tag"
}

# publish with npm - commented until this issue is resolved: https://github.com/actions/bin/issues/13
#action "publish" {
# needs = "check for new tag"
# uses = "actions/[email protected]"
# args = "publish"
# secrets = ["NPM_AUTH_TOKEN"]
#}
19 changes: 19 additions & 0 deletions .github/node-chrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Taken from https://raw.githubusercontent.com/filipesilva/ng-github-actions/master/.github/node-chrome/Dockerfile
# and https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
FROM node:10

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ addons:
chrome: stable
language: node_js
node_js:
- "6"
- "8"
- "10"
sudo: required
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:10

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb

WORKDIR /TypeStrong/ts-loader

# install packages
COPY package.json yarn.lock index.js /TypeStrong/ts-loader/
RUN yarn

# build
COPY src /TypeStrong/ts-loader/src
RUN yarn build

# test
COPY test /TypeStrong/ts-loader/test

# build and run tests with:
# docker build -t ts-loader .
# docker run -it ts-loader yarn test
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"lint": "tslint --project \"./src\"",
"comparison-tests": "tsc --project \"./test/comparison-tests\" && npm link ./test/comparison-tests/testLib && node test/comparison-tests/run-tests.js",
"comparison-tests-generate": "node test/comparison-tests/stub-new-version.js",
"execution-tests": "npm i -g pnpm && node test/execution-tests/run-tests.js",
"test": "node test/run-tests.js"
"execution-tests": "node test/execution-tests/run-tests.js",
"test": "node test/run-tests.js",
"docker:build": "docker build -t ts-loader .",
"postdocker:build": "docker run -it ts-loader yarn test"
},
"husky": {
"hooks": {
Expand Down
6 changes: 3 additions & 3 deletions test/comparison-tests/create-and-execute-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ 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\/\.test/g, '')
.replace(/(C\:\/)?[\w|\/]*\/(ts-loader|workspace)\/\.test/g, '')
.replace(/webpack:\/\/(C:\/)?[\w|\/|-]*\/comparison-tests\//g, 'webpack://comparison-tests/')
.replace(/WEBPACK FOOTER\/n\/ (C:\/)?[\w|\/|-]*\/comparison-tests\//g, 'WEBPACK FOOTER/n/ /ts-loader/test/comparison-tests/')
.replace(/!\** (C\:\/)?[\w|\/|-]*\/comparison-tests\//g, '!*** /ts-loader/test/comparison-tests/')
Expand All @@ -440,9 +440,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[\/|\\]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[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
.replace(/\(\S+[\/|\\](ts-loader|workspace)[\/|\\]dist[\/|\\]index.js:\d*:\d*\)/g, '(ts-loader)');
}

/**
Expand Down
49 changes: 8 additions & 41 deletions test/execution-tests/1.8.2_allowJs-entryFileIsJs/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
/* eslint-disable no-var, strict */
'use strict';
var path = require('path');
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
var reporterOptions = require('../../reporterOptions');
var makeKarmaConfig = require('../../karmaConfig');

module.exports = function(config) {
config.set({
browsers: [ 'ChromeHeadless' ],

files: [
// This loads all the tests
'./**/*.tests.js'
],

port: 9876,

frameworks: [ 'jasmine' ],

logLevel: config.LOG_INFO, //config.LOG_DEBUG

preprocessors: {
'./**/*.js': [ 'webpack', 'sourcemap' ]
},

webpack: {
devtool: 'inline-source-map',
mode: webpackConfig.mode,
module: webpackConfig.module,
resolve: webpackConfig.resolve,

// for test harness purposes only, you would not need this in a normal project
resolveLoader: webpackConfig.resolveLoader
},

webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},

// reporter options
mochaReporter: reporterOptions,
});
config.set(
makeKarmaConfig({
config,
webpackConfig,
files: ['./**/*.tests.js']
})
);
};
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
/* eslint-disable no-var, strict */
'use strict';
var path = require('path');
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
var reporterOptions = require('../../reporterOptions');
var makeKarmaConfig = require('../../karmaConfig');

module.exports = function(config) {
config.set({
browsers: [ 'ChromeHeadless' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
'main.js'
],

port: 9876,

frameworks: [ 'jasmine' ],

logLevel: config.LOG_INFO, //config.LOG_DEBUG

preprocessors: {
'main.js': [ 'webpack', 'sourcemap' ]
},

webpack: {
devtool: 'inline-source-map',
mode: webpackConfig.mode,
module: webpackConfig.module,
resolve: webpackConfig.resolve,

// for test harness purposes only, you would not need this in a normal project
resolveLoader: webpackConfig.resolveLoader
},

webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},

// reporter options
mochaReporter: reporterOptions,
});
config.set(
makeKarmaConfig({
config,
webpackConfig,
files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
'main.js'
]
})
);
};
52 changes: 11 additions & 41 deletions test/execution-tests/2.0.3_typesResolution/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
/* eslint-disable no-var, strict */
'use strict';
var path = require('path');
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
var reporterOptions = require('../../reporterOptions');
var makeKarmaConfig = require('../../karmaConfig');

module.exports = function(config) {
config.set({
browsers: [ 'ChromeHeadless' ],

files: [
// This loads all the tests
'main.js'
],

port: 9876,

frameworks: [ 'jasmine' ],

logLevel: config.LOG_INFO, //config.LOG_DEBUG

preprocessors: {
'main.js': [ 'webpack', 'sourcemap' ]
},

webpack: {
devtool: 'inline-source-map',
mode: webpackConfig.mode,
module: webpackConfig.module,
resolve: webpackConfig.resolve,

// for test harness purposes only, you would not need this in a normal project
resolveLoader: webpackConfig.resolveLoader
},

webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},

// reporter options
mochaReporter: reporterOptions
});
config.set(
makeKarmaConfig({
config,
webpackConfig,
files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
'main.js'
]
})
);
};
51 changes: 11 additions & 40 deletions test/execution-tests/2.1.4_babel-allowJsImportTypes/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
/* eslint-disable no-var, strict */
'use strict';
var webpackConfig = require('./webpack.config.js');
var reporterOptions = require('../../reporterOptions');
var makeKarmaConfig = require('../../karmaConfig');

module.exports = function(config) {
// Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html
config.set({
browsers: [ 'ChromeHeadless' ],

files: [
// This ensures we have the es6 shims in place and then loads all the tests
'main.js'
],

port: 9876,

frameworks: [ 'jasmine' ],

logLevel: config.LOG_INFO, //config.LOG_DEBUG

preprocessors: {
'main.js': [ 'webpack', 'sourcemap' ]
},

webpack: {
devtool: 'inline-source-map',
mode: webpackConfig.mode,
module: webpackConfig.module,
resolve: webpackConfig.resolve,

// for test harness purposes only, you would not need this in a normal project
resolveLoader: webpackConfig.resolveLoader
},

webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},

// reporter options
mochaReporter: reporterOptions
});
config.set(
makeKarmaConfig({
config,
webpackConfig,
files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
'main.js'
]
})
);
};
Loading