Skip to content

Commit 6f77d5f

Browse files
evilebottnawialexander-akait
authored andcommittedApr 26, 2019
feat: migrate on azure pipelines (#172)
BREAKING CHANGE: now we use `azure-pipelines` for CI
1 parent 3fe0d9a commit 6f77d5f

File tree

7 files changed

+209
-201
lines changed

7 files changed

+209
-201
lines changed
 

‎src/tasks/git.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ const gitignore = [
2626

2727
const gitattributes = [
2828
'* text=auto',
29-
'package-lock.json -diff',
29+
'bin/* eol=lf',
3030
'yarn.lock -diff',
31+
'package-lock.json -diff',
3132
];
3233

3334
module.exports = () => {

‎src/tasks/package.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ const devPackages = [
1616
'standard-version',
1717
'@commitlint/cli',
1818
'@commitlint/config-conventional',
19+
'commitlint-azure-pipelines-cli',
1920
'husky',
2021

2122
// Jest
2223
'jest',
24+
'jest-junit',
2325
'babel-jest',
2426

2527
// Babel
@@ -80,12 +82,7 @@ module.exports = (config) => {
8082
'test:watch': 'jest --watch',
8183
'test:coverage': "jest --collectCoverageFrom='src/**/*.js' --coverage",
8284
pretest: 'npm run lint',
83-
test: 'npm run test:only',
84-
'ci:lint': 'npm run lint && npm run security',
85-
'ci:test': 'npm run test:only -- --runInBand',
86-
'ci:coverage': 'npm run test:coverage -- --runInBand',
87-
'ci:lint:commits':
88-
'commitlint --from=origin/master --to=${CIRCLE_SHA1}',
85+
test: 'npm run test:coverage',
8986
defaults: 'webpack-defaults',
9087
},
9188
files: existing.files || ['dist/', 'lib/', 'index.js'],

‎src/tasks/templates.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ const { copyFiles } = require('mrm-core');
55

66
// These files will be overwritten without any confirmation
77
const files = [
8-
'.circleci/config.yml',
98
'.github/CODEOWNERS',
109
'.github/PULL_REQUEST_TEMPLATE.md',
1110
'.github/CONTRIBUTING.md',
1211
'.editorconfig',
1312
'.eslintrc.js',
14-
'appveyor.yml',
13+
'azure-pipelines.yml',
1514
'LICENSE',
1615
];
1716

‎templates/.circleci/config.yml

-145
This file was deleted.

‎templates/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ Please take a moment to read our contributing guidelines if you haven't yet done
154154
[node-url]: https://nodejs.org
155155
[deps]: https://david-dm.org/webpack-contrib/${package}.svg
156156
[deps-url]: https://david-dm.org/webpack-contrib/${package}
157-
[tests]: https://img.shields.io/circleci/project/github/webpack-contrib/${package}.svg
158-
[tests-url]: https://circleci.com/gh/webpack-contrib/${package}
157+
[tests]: https://dev.azure.com/webpack-contrib/${package}/_apis/build/status/webpack-contrib.${package}?branchName=master
158+
[tests-url]: https://dev.azure.com/webpack-contrib/${package}/_build/latest?definitionId=2&branchName=master
159159
[cover]: https://codecov.io/gh/webpack-contrib/${package}/branch/master/graph/badge.svg
160160
[cover-url]: https://codecov.io/gh/webpack-contrib/${package}
161161
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg

‎templates/appveyor.yml

-45
This file was deleted.

‎templates/azure-pipelines.yml

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
trigger:
2+
- master
3+
- next
4+
5+
jobs:
6+
- job: Lint
7+
pool:
8+
vmImage: ubuntu-16.04
9+
steps:
10+
- task: NodeTool@0
11+
inputs:
12+
versionSpec: ^10.13.0
13+
displayName: 'Install Node.js'
14+
- task: Npm@1
15+
inputs:
16+
command: custom
17+
customCommand: i -g npm@latest
18+
displayName: 'Install latest NPM'
19+
- script: |
20+
node -v
21+
npm -v
22+
displayName: 'Print versions'
23+
- task: Npm@1
24+
inputs:
25+
command: custom
26+
customCommand: ci
27+
displayName: 'Install dependencies'
28+
- script: npm run lint
29+
displayName: 'Run lint'
30+
- script: npm run security
31+
displayName: 'Run NPM audit'
32+
- script: ./node_modules/.bin/commitlint-azure-pipelines
33+
displayName: 'Run lint commit message'
34+
35+
- job: Linux
36+
pool:
37+
vmImage: ubuntu-16.04
38+
strategy:
39+
maxParallel: 5
40+
matrix:
41+
node-12:
42+
node_version: ^12.0.0
43+
webpack_version: latest
44+
node-10:
45+
node_version: ^10.13.0
46+
webpack_version: latest
47+
node-8:
48+
node_version: ^8.9.0
49+
webpack_version: latest
50+
node-6:
51+
node_version: ^6.9.0
52+
webpack_version: latest
53+
node-8-canary:
54+
node_version: ^8.9.0
55+
webpack_version: next
56+
continue_on_error: true
57+
steps:
58+
- task: NodeTool@0
59+
inputs:
60+
versionSpec: $(node_version)
61+
displayName: 'Install Node.js $(node_version)'
62+
- task: Npm@1
63+
inputs:
64+
command: custom
65+
customCommand: i -g npm@latest
66+
displayName: 'Install latest NPM'
67+
- script: |
68+
node -v
69+
npm -v
70+
displayName: 'Print versions'
71+
- task: Npm@1
72+
inputs:
73+
command: custom
74+
customCommand: ci
75+
displayName: 'Install dependencies'
76+
- script: npm i webpack@$(webpack_version)
77+
displayName: 'Install "webpack@$(webpack_version)"'
78+
- script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" || $(continue_on_error)
79+
displayName: 'Run tests with coverage'
80+
- task: PublishTestResults@2
81+
inputs:
82+
testRunTitle: 'Linux with Node.js $(node_version)'
83+
testResultsFiles: '**/junit.xml'
84+
condition: succeededOrFailed()
85+
displayName: 'Publish test results'
86+
- script: curl -s https://codecov.io/bash | bash -s -- -t $(CODECOV_TOKEN)
87+
condition: succeededOrFailed()
88+
displayName: 'Submit coverage data to codecov'
89+
90+
- job: macOS
91+
pool:
92+
vmImage: macOS-10.14
93+
strategy:
94+
maxParallel: 5
95+
matrix:
96+
node-12:
97+
node_version: ^12.0.0
98+
webpack_version: latest
99+
node-10:
100+
node_version: ^10.13.0
101+
webpack_version: latest
102+
node-8:
103+
node_version: ^8.9.0
104+
webpack_version: latest
105+
node-6:
106+
node_version: ^6.9.0
107+
webpack_version: latest
108+
node-8-canary:
109+
node_version: ^8.9.0
110+
webpack_version: next
111+
continue_on_error: true
112+
steps:
113+
- task: NodeTool@0
114+
inputs:
115+
versionSpec: $(node_version)
116+
displayName: 'Install Node.js $(node_version)'
117+
- task: Npm@1
118+
inputs:
119+
command: custom
120+
customCommand: i -g npm@latest
121+
displayName: 'Install latest NPM'
122+
- script: |
123+
node -v
124+
npm -v
125+
displayName: 'Print versions'
126+
- task: Npm@1
127+
inputs:
128+
command: custom
129+
customCommand: ci
130+
displayName: 'Install dependencies'
131+
- script: npm i webpack@$(webpack_version)
132+
displayName: 'Install "webpack@$(webpack_version)"'
133+
- script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" || $(continue_on_error)
134+
displayName: 'Run tests with coverage'
135+
- task: PublishTestResults@2
136+
inputs:
137+
testRunTitle: 'Linux with Node.js $(node_version)'
138+
testResultsFiles: '**/junit.xml'
139+
condition: succeededOrFailed()
140+
displayName: 'Publish test results'
141+
- script: curl -s https://codecov.io/bash | bash -s -- -t $(CODECOV_TOKEN)
142+
condition: succeededOrFailed()
143+
displayName: 'Submit coverage data to codecov'
144+
145+
- job: Windows
146+
pool:
147+
vmImage: windows-2019
148+
strategy:
149+
maxParallel: 5
150+
matrix:
151+
node-12:
152+
node_version: ^12.0.0
153+
webpack_version: latest
154+
node-10:
155+
node_version: ^10.13.0
156+
webpack_version: latest
157+
node-8:
158+
node_version: ^8.9.0
159+
webpack_version: latest
160+
node-6:
161+
node_version: ^6.9.0
162+
webpack_version: latest
163+
node-8-canary:
164+
node_version: ^8.9.0
165+
webpack_version: next
166+
continue_on_error: true
167+
steps:
168+
- script: 'git config --global core.autocrlf input'
169+
displayName: 'Config git core.autocrlf'
170+
- checkout: self
171+
- task: NodeTool@0
172+
inputs:
173+
versionSpec: $(node_version)
174+
displayName: 'Install Node.js $(node_version)'
175+
- task: Npm@1
176+
inputs:
177+
command: custom
178+
customCommand: i -g npm@latest
179+
displayName: 'Install latest NPM'
180+
- script: |
181+
node -v
182+
npm -v
183+
displayName: 'Print versions'
184+
- task: Npm@1
185+
inputs:
186+
command: custom
187+
customCommand: ci
188+
displayName: 'Install dependencies'
189+
- script: npm i webpack@$(webpack_version)
190+
displayName: 'Install "webpack@$(webpack_version)"'
191+
- script: npm run test:coverage -- --ci --reporters="default" --reporters="jest-junit" || $(continue_on_error)
192+
displayName: 'Run tests with coverage'
193+
- task: PublishTestResults@2
194+
inputs:
195+
testRunTitle: 'Linux with Node.js $(node_version)'
196+
testResultsFiles: '**/junit.xml'
197+
condition: succeededOrFailed()
198+
displayName: 'Publish test results'
199+
- script: curl -s https://codecov.io/bash | bash -s -- -t $(CODECOV_TOKEN)
200+
condition: succeededOrFailed()
201+
displayName: 'Submit coverage data to codecov'

0 commit comments

Comments
 (0)
Please sign in to comment.