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

Windows CI matrix #752

Merged
merged 4 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
test:
needs: discover_matrix
name: ${{ matrix.name }}
runs-on: ubuntu-latest
runs-on: "${{ matrix.os }}-latest"

strategy:
fail-fast: false
matrix: ${{fromJson(needs.discover_matrix.outputs.matrix)}}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@types/jest": "^24.0.11",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"cross-env": "^7.0.3",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
Expand Down
10 changes: 7 additions & 3 deletions packages/compat/src/detect-babel-plugins.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PluginItem } from '@babel/core';
import { join, sep } from 'path';

export function isEmberAutoImportDynamic(item: PluginItem): boolean {
let pluginPath: string;
Expand All @@ -9,7 +10,8 @@ export function isEmberAutoImportDynamic(item: PluginItem): boolean {
} else {
return false;
}
return /(^|\/)ember-auto-import\//.test(pluginPath);

return pluginPath.includes(join(sep, 'ember-auto-import', sep));
}

export function isCompactReexports(item: PluginItem): boolean {
Expand All @@ -21,7 +23,8 @@ export function isCompactReexports(item: PluginItem): boolean {
} else {
return false;
}
return /(^|\/)babel-plugin-compact-reexports\//.test(pluginPath);

return pluginPath.includes(join('babel-plugin-compact-reexports', sep));
}

export function isColocationPlugin(item: PluginItem): boolean {
Expand All @@ -33,5 +36,6 @@ export function isColocationPlugin(item: PluginItem): boolean {
} else {
return false;
}
return /(^|\/)ember-cli-htmlbars\/lib\/colocated-babel-plugin/.test(pluginPath);

return pluginPath.includes(join('ember-cli-htmlbars', 'lib', 'colocated-babel-plugin', sep));
}
4 changes: 2 additions & 2 deletions packages/compat/src/v1-app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Memoize } from 'typescript-memoize';
import { sync as pkgUpSync } from 'pkg-up';
import { join, dirname } from 'path';
import { join, dirname, isAbsolute } from 'path';
import Funnel from 'broccoli-funnel';
import mergeTrees from 'broccoli-merge-trees';
import { WatchedDir } from 'broccoli-source';
Expand Down Expand Up @@ -532,7 +532,7 @@ export default class V1App {
}
// non node assets are local paths. They need an explicit `/` or `.` at
// the start.
if (asset.startsWith('/') || asset.startsWith('.')) {
if (asset.startsWith('.') || isAbsolute(asset)) {
return asset;
}
return './' + asset;
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,8 +1271,9 @@ export class AppBuilder<TreeNames> {
}

let runtime = join(packageName, name).replace(this.resolvableExtensionsPattern, '');
if (renamedModules && renamedModules[runtime]) {
runtime = renamedModules[runtime];
let runtimeRenameLookup = runtime.split('\\').join('/');
Copy link
Collaborator Author

@thoov thoov Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime will look like: ember-source\ember\index because of the join.

renamedModules will contain items like:

{
...
'ember-source/ember/index': 'ember/index'
...

which fails to do the lookup. This converts the lookup to be in the expected format. I didn't change the meta info format as I'm not sure the full ramifications of that but a longer term solution would be to look into that.

if (renamedModules && renamedModules[runtimeRenameLookup]) {
runtime = renamedModules[runtimeRenameLookup];
}
runtime = runtime.split(sep).join('/');
lazyModules.push({
Expand Down
3 changes: 2 additions & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "npm-run-all lint:* test:*",
"test:all": "ember try:each",
"test:ember": "ember test --test-port=0",
"test:classic": "CLASSIC=true ember test --test-port=0"
"test:classic": "cross-env CLASSIC=true ember test --test-port=0"
},
"dependencies": {
"@embroider/macros": "0.39.1",
Expand All @@ -40,6 +40,7 @@
"@types/ember__routing": "^3.16.9",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"cross-env": "^7.0.3",
"ember-cli": "~3.10.1",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-eslint": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-internals/src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { relative, isAbsolute, dirname, join, basename } from 'path';
//
export function explicitRelative(fromDir: string, toFile: string) {
let result = join(relative(fromDir, dirname(toFile)), basename(toFile));
if (!result.startsWith('/') && !result.startsWith('.')) {
if (!isAbsolute(result) && !result.startsWith('.')) {
result = './' + result;
}
if (isAbsolute(toFile) && result.endsWith(toFile)) {
Expand Down
5 changes: 3 additions & 2 deletions packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "npm-run-all lint test:*",
"test:ember": "EMBROIDER_TEST_SETUP_FORCE=embroider EMBROIDER_TEST_SETUP_OPTIONS=optimized ember test --test-port=0",
"test:classic": "EMBROIDER_TEST_SETUP_FORCE=classic ember test --test-port=0",
"test:ember": "cross-env EMBROIDER_TEST_SETUP_FORCE=embroider EMBROIDER_TEST_SETUP_OPTIONS=optimized ember test --test-port=0",
"test:classic": "cross-env EMBROIDER_TEST_SETUP_FORCE=classic ember test --test-port=0",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
Expand All @@ -46,6 +46,7 @@
"@typescript-eslint/parser": "^4.1.1",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"cross-env": "^7.0.3",
"ember-auto-import": "^1.10.1",
"ember-cli": "~3.25.2",
"ember-cli-dependency-checker": "^3.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/webpack/src/ember-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const Webpack: Packager<Options> = class Webpack implements PackagerInstance {
hints: false,
},
plugins: [
//@ts-ignore
new MiniCssExtractPlugin({
filename: `chunk.[chunkhash].css`,
chunkFilename: `chunk.[chunkhash].css`,
Expand Down
6 changes: 3 additions & 3 deletions test-packages/engines-host-app/fastboot-tests/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module.exports = function setup(hooks) {
return dom.window.document;
}

hooks.before(async function(assert) {
hooks.before(async function (assert) {
if (!process.env.REUSE_FASTBOOT_BUILD) {
execFileSync('node', ['./node_modules/.bin/ember', 'build']);
execFileSync('node', ['../../node_modules/ember-cli/bin/ember', 'build']);
process.env.REUSE_FASTBOOT_BUILD = 'true';
}
fastboot = new FastBoot({
Expand All @@ -33,7 +33,7 @@ module.exports = function setup(hooks) {
});
this.visit = visit.bind(this, assert);
});
hooks.beforeEach(function(assert) {
hooks.beforeEach(function (assert) {
this.visit = visit.bind(this, assert);
});
};
4 changes: 2 additions & 2 deletions test-packages/engines-host-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test --test-port=0",
"test:ember-classic": "CLASSIC=true ember test --test-port=0",
"test:ember-classic": "cross-env CLASSIC=true ember test --test-port=0",
"test:fastboot": "qunit fastboot-tests",
"test:fastboot-classic": "CLASSIC=true qunit fastboot-tests"
"test:fastboot-classic": "cross-env CLASSIC=true qunit fastboot-tests"
},
"devDependencies": {
"@ember/jquery": "^0.6.0",
Expand Down
6 changes: 3 additions & 3 deletions test-packages/fastboot-app/fastboot-tests/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module.exports = function setup(hooks, buildArgs = []) {
return dom.window.document;
}

hooks.before(async function(assert) {
hooks.before(async function (assert) {
if (!process.env.REUSE_FASTBOOT_BUILD) {
execFileSync('node', ['./node_modules/.bin/ember', 'build', ...buildArgs]);
execFileSync('node', ['../../node_modules/ember-cli/bin/ember', 'build', ...buildArgs]);
process.env.REUSE_FASTBOOT_BUILD = 'true';
}
fastboot = new FastBoot({
Expand All @@ -33,7 +33,7 @@ module.exports = function setup(hooks, buildArgs = []) {
});
this.visit = visit.bind(this, assert);
});
hooks.beforeEach(function(assert) {
hooks.beforeEach(function (assert) {
this.visit = visit.bind(this, assert);
});
};
6 changes: 3 additions & 3 deletions test-packages/fastboot-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test --test-port=0",
"test:ember-classic": "CLASSIC=true ember test --test-port=0",
"test:ember-classic": "cross-env CLASSIC=true ember test --test-port=0",
"test:ember-production": "ember test --test-port=0 --environment=production",
"test:fastboot": "qunit fastboot-tests",
"test:fastboot-production": "FASTBOOT_APP_PROD=true qunit fastboot-tests",
"test:fastboot-classic": "CLASSIC=true FASTBOOT_APP_PROD=true qunit fastboot-tests"
"test:fastboot-production": "cross-env FASTBOOT_APP_PROD=true qunit fastboot-tests",
"test:fastboot-classic": "cross-env CLASSIC=true FASTBOOT_APP_PROD=true qunit fastboot-tests"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion test-packages/macro-sample-addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test": "npm-run-all lint:* test:*",
"test:all": "ember try:each",
"test:ember": "ember test --test-port=0",
"test:classic:": "CLASSIC=true ember test --test-port=0"
"test:classic:": "cross-env CLASSIC=true ember test --test-port=0"
},
"dependencies": {
"@embroider/macros": "0.39.1",
Expand Down
2 changes: 1 addition & 1 deletion test-packages/macro-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test --test-port=0",
"test:ember-classic": "CLASSIC=true ember test --test-port=0"
"test:ember-classic": "cross-env CLASSIC=true ember test --test-port=0"
},
"devDependencies": {
"@ember/jquery": "^0.6.0",
Expand Down
6 changes: 3 additions & 3 deletions test-packages/static-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test --test-port=0",
"test:ember-classic": "CLASSIC=true ember test --test-port=0",
"test:custom-root": "CUSTOM_ROOT_URL=/custom/ ember test --test-port=0",
"test:custom-relative-root": "CUSTOM_ROOT_URL=custom-relative-root-url/ ember test --test-port=0"
"test:ember-classic": "cross-env CLASSIC=true ember test --test-port=0",
"test:custom-root": "cross-env CUSTOM_ROOT_URL=/custom/ ember test --test-port=0",
"test:custom-relative-root": "cross-env CUSTOM_ROOT_URL=custom-relative-root-url/ ember test --test-port=0"
},
"devDependencies": {
"@ember/jquery": "^0.5.2",
Expand Down
44 changes: 31 additions & 13 deletions test-packages/support/suite-setup-util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { tmpdir } from 'os';
import { basename, join, resolve } from 'path';
import { basename, join, relative, resolve } from 'path';
import { readdirSync, statSync, unlinkSync, writeFileSync } from 'fs-extra';

// we sometimes run our various Ember app's test suites in parallel, and
Expand Down Expand Up @@ -81,6 +81,12 @@ export async function allSuites({ includeEmberTry } = { includeEmberTry: true })
return suites;
}

function relativeToEmbroiderRoot(absolutePath: string): string {
let embroiderRoot = resolve(__dirname, '../..');

return relative(embroiderRoot, absolutePath);
}

export async function githubMatrix() {
let suites = await allSuites();

Expand All @@ -92,21 +98,33 @@ export async function githubMatrix() {
dir: resolve(__dirname, '..', '..'),
});

// add our eslint
suites.unshift({
name: 'lint',
command: 'yarn',
args: ['lint'],
dir: resolve(__dirname, '..', '..'),
});

return {
name: suites.map(s => s.name),
include: suites.map(s => ({
name: s.name,
let include = [
// add our eslint
{
name: 'lint',
os: 'ubuntu',
command: 'yarn lint',
dir: resolve(__dirname, '..', '..'),
},
...suites.map(s => ({
name: `${s.name} ubuntu`,
os: 'ubuntu',
command: `${s.command} ${s.args.join(' ')}`,
dir: s.dir,
})),
...suites
.filter(s => s.name !== 'node') // TODO: node tests do not work under windows yet
.map(s => ({
name: `${s.name} windows`,
os: 'windows',
command: `${s.command} ${s.args.join(' ')}`,
dir: relativeToEmbroiderRoot(s.dir),
})),
];

return {
name: include.map(s => s.name),
include,
};
}

Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6115,6 +6115,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
Expand All @@ -6126,7 +6133,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down