From fee669080c31008309e83e5979c0662e0d448f67 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 11 Sep 2018 10:43:07 +0200 Subject: [PATCH] Add simple azure pipeline --- azure-pipelines.yml | 177 ++++++++++++++++++ .../define-plugin/webpack.config.js | 4 +- 2 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..a16f37c3324 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,177 @@ +jobs: + - job: basic + pool: + vmImage: ubuntu-16.04 + steps: + - task: NodeTool@0 + displayName: "Install Node.js" + inputs: + versionSpec: "^10.10.0" + - script: | + curl -o- -L https://yarnpkg.com/install.sh | bash + displayName: "Install Yarn" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + node -v + yarn -v + displayName: "Print versions" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile + displayName: "Install dependencies" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn test:basic --ci + yarn test:unit --ci + displayName: "Run basic tests" + - job: lint + pool: + vmImage: ubuntu-16.04 + steps: + - task: NodeTool@0 + displayName: "Install Node.js" + inputs: + versionSpec: "^10.10.0" + - script: | + curl -o- -L https://yarnpkg.com/install.sh | bash + displayName: "Install Yarn" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + node -v + yarn -v + displayName: "Print versions" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile + displayName: "Install dependencies" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn lint + displayName: "Run linting" + - job: linux + dependsOn: + - basic + - lint + pool: + vmImage: ubuntu-16.04 + strategy: + maxParallel: 3 + matrix: + node-10: + node_version: ^10.10.0 + node-8: + node_version: ^8.12.0 + node-6: + node_version: ^6.14.4 + steps: + - task: NodeTool@0 + displayName: "Install Node.js" + inputs: + versionSpec: $(node_version) + - script: | + curl -o- -L https://yarnpkg.com/install.sh | bash + displayName: "Install Yarn" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + node -v + yarn -v + displayName: "Print versions" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile + displayName: "Install dependencies" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn cover:init + yarn cover:integration "test/(?!TestCases)" --ci --maxWorkers=2 + mv coverage/coverage-final.json coverage/coverage-final-1.json + yarn cover:integration "test/TestCasesD" --ci --maxWorkers=2 + mv coverage/coverage-final.json coverage/coverage-final-2.json + yarn cover:integration "test/TestCases(?!D)" --ci --maxWorkers=2 + mv coverage/coverage-final.json coverage/coverage-final-3.json + displayName: "Run tests with coverage" + - job: macos + dependsOn: + - basic + - lint + pool: + vmImage: "macOS 10.13" + strategy: + maxParallel: 3 + matrix: + node-10: + node_version: ^10.10.0 + node-8: + node_version: ^8.12.0 + node-6: + node_version: ^6.14.4 + steps: + - task: NodeTool@0 + displayName: "Install Node.js" + inputs: + versionSpec: $(node_version) + - script: | + curl -o- -L https://yarnpkg.com/install.sh | bash + displayName: "Install Yarn" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + node -v + yarn -v + displayName: "Print versions" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile + displayName: "Install dependencies" + - script: | + export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" + yarn cover:init + yarn cover:integration "test/(?!TestCases)" --ci + mv coverage/coverage-final.json coverage/coverage-final-1.json + yarn cover:integration "test/TestCasesD" --ci + mv coverage/coverage-final.json coverage/coverage-final-2.json + yarn cover:integration "test/TestCases(?!D)" --ci + mv coverage/coverage-final.json coverage/coverage-final-3.json + displayName: "Run tests with coverage" + - job: windows + dependsOn: + - basic + - lint + pool: + vmImage: vs2017-win2016 + strategy: + maxParallel: 3 + matrix: + node-10: + node_version: ^10.10.0 + node-8: + node_version: ^8.12.0 + node-6: + node_version: ^6.14.4 + steps: + - task: NodeTool@0 + displayName: "Install Node.js" + inputs: + versionSpec: $(node_version) + - script: | + npm install --global yarn + displayName: "Install Yarn" + - script: | + node -v + yarn -v + displayName: "Print versions" + - script: | + yarn --frozen-lockfile + yarn link --frozen-lockfile || true + yarn link webpack --frozen-lockfile + displayName: "Install dependencies" + - script: + yarn cover:init && yarn cover:integration "test/(?!TestCases)" --ci && move coverage\\coverage-final.json coverage\\coverage-final-1.json && yarn cover:integration "test/TestCasesD" --ci && move coverage\\coverage-final.json coverage\\coverage-final-2.json && yarn cover:integration "test/TestCases(?!D)" --ci && move coverage\\coverage-final.json coverage\\coverage-final-3.json + displayName: "Run tests with coverage" diff --git a/test/statsCases/define-plugin/webpack.config.js b/test/statsCases/define-plugin/webpack.config.js index 32d87e4f89a..e5b72f1d595 100644 --- a/test/statsCases/define-plugin/webpack.config.js +++ b/test/statsCases/define-plugin/webpack.config.js @@ -3,7 +3,9 @@ var fs = require("fs"); var join = require("path").join; function read(path) { - return JSON.stringify(fs.readFileSync(join(__dirname, path), "utf8")); + return JSON.stringify( + fs.readFileSync(join(__dirname, path), "utf8").replace(/\r\n/g, "\n") + ); } module.exports = [