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

Azure pipelines #3 #100

Merged
merged 3 commits into from
Dec 13, 2018
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
33 changes: 33 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
branches:
include:
- master
paths:
exclude:
- docs/*

pool:
# todo: we dgaf what specific version of Linux is installed, is there any way to wildcard the version?
vmImage: 'Ubuntu-16.04'

steps:
- script: |
npm install
displayName: 'npm install'
- script: |
npm run bootstrap-packages
displayName: 'bootstrapping packages'
- script: |
npm run build-packages
displayName: 'building packages'
- script: |
npm run test-packages
displayName: 'running tests'
env: {
testEnv: 'ci'
}
32 changes: 11 additions & 21 deletions packages/sitecore-jss-angular/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/* eslint-disable func-names */

module.exports = function(config) {
config.set({
const karmaConfig = {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'karma-typescript'],

// list of files / patterns to load in the browser
files: [
{ pattern: 'node_modules/reflect-metadata/Reflect.js', watched: false },
Expand All @@ -21,21 +19,14 @@ module.exports = function(config) {
{ pattern: 'node_modules/zone.js/dist/fake-async-test.js', watched: false },
{ pattern: './src/**/*.ts' },
],

// list of files to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'**/*.ts': ['karma-typescript'],
},

preprocessors: { '**/*.ts': ['karma-typescript'] },
karmaTypescriptConfig: {
include: ['./src/**/*.ts'],
compilerOptions: {
lib: ['es2017', 'dom'],
},
compilerOptions: { lib: ['es2017', 'dom'] },
reports: {
'json-summary': {
directory: './coverage',
Expand All @@ -45,35 +36,34 @@ module.exports = function(config) {
text: '',
},
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'karma-typescript'],

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
});
};

if (process.env.testEnv && process.env.testEnv === 'ci') {
karmaConfig.browsers = ['ChromeHeadless'];
karmaConfig.singleRun = true;
}

config.set(karmaConfig);
};