Skip to content

Commit ea592a1

Browse files
filipesilvahansl
authored andcommitted
ci: add Circle CI
1 parent 634a041 commit ea592a1

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

.circleci/config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/angular-cli
5+
docker:
6+
- image: angular/ngcontainer
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
key: angular-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
11+
- run: yarn --frozen-lockfile
12+
- save_cache:
13+
key: angular-cli-{{ .Branch }}-{{ checksum "yarn.lock" }}
14+
paths:
15+
- "node_modules"
16+
- run: xvfb-run -a node tests/run_e2e.js --glob=tests/build/**

tests/e2e/setup/100-npm-link.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {join} from 'path';
2-
import {npm, exec} from '../utils/process';
2+
import {silentNpm, exec} from '../utils/process';
33
import {updateJsonFile} from '../utils/project';
44
import {getGlobalVariable} from '../utils/env';
55

@@ -33,7 +33,8 @@ export default function () {
3333
}
3434
});
3535
}))
36-
.then(() => npm('link'))
36+
// npm link is very noisy on the older version used in Circle CI.
37+
.then(() => silentNpm('link'))
3738
.then(() => process.chdir(oldCwd));
3839
})
3940
.then(() => exec(process.platform.startsWith('win') ? 'where' : 'which', 'ng'));

tests/e2e/setup/500-create-project.ts

+12
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,25 @@ export default function() {
3838
}))
3939
// There's a race condition happening in Chrome. Enabling logging in chrome used by
4040
// protractor actually fixes it. Logging is piped to a file so it doesn't affect our setup.
41+
// --no-sandbox is needed for Circle CI.
4142
.then(() => replaceInFile('protractor.conf.js', `'browserName': 'chrome'`,
4243
`'browserName': 'chrome',
4344
chromeOptions: {
4445
args: [
4546
"--enable-logging",
47+
"--no-sandbox",
4648
]
4749
}
4850
`))
51+
.then(() => replaceInFile('karma.conf.js', `browsers: ['Chrome'],`,
52+
`browsers: ['ChromeNoSandbox'],
53+
customLaunchers: {
54+
ChromeNoSandbox: {
55+
base: 'Chrome',
56+
flags: ['--no-sandbox']
57+
}
58+
},
59+
`))
4960
.then(() => argv['ng2'] ? useNg2() : Promise.resolve())
5061
.then(() => {
5162
if (argv['nightly'] || argv['ng-sha']) {
@@ -88,6 +99,7 @@ export default function() {
8899
progress: false
89100
};
90101
}))
102+
// npm link on Circle CI is very noisy.
91103
.then(() => silentNpm('install'))
92104
// Force sourcemaps to be from the root of the filesystem.
93105
.then(() => updateTsConfig(json => {

tests/e2e/tests/build/poll.ts

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ import {expectToFail, wait} from '../../utils/utils';
99
const webpackGoodRegEx = /webpack: Compiled successfully./;
1010

1111
export default function() {
12+
13+
// @filipesilva: This test doesn't work correctly on CircleCI while being ran by the test script.
14+
// Polling time seems to be ignored and several builds are fired per second.
15+
// Debugging showed that webpack things the `src/` directory changed on each rebuild.
16+
// Disabling for now.
17+
if (process.env['CIRCLECI']) {
18+
return;
19+
}
20+
21+
1222
return silentExecAndWaitForOutputToMatch('ng', ['serve', '--poll=10000'], webpackGoodRegEx)
1323
// Wait before editing a file.
1424
// Editing too soon seems to trigger a rebuild and throw polling out of whack.

0 commit comments

Comments
 (0)