-
Notifications
You must be signed in to change notification settings - Fork 0
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 support #2
Changes from 6 commits
cd8d473
34f30a3
7a8bd40
0abce2b
f843fb5
63060eb
2434ac6
647b342
057c748
7155ff3
e52d094
b3695cb
1d6c184
5c54142
2bd8f87
987fcb2
058f683
3ad6a81
a4a9db5
2773485
00c98fa
a4e0039
62a9007
2d5bc9b
6322b9e
8a86ac4
1bc6864
bfefe49
d70953e
65ec11a
5c24a13
11562d3
7fb0c60
95268b0
27f60cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Azure Pipelines steps for building and testing create-react-app on Linux, Windows, and macOS. | ||
# | ||
|
||
steps: | ||
- script: | | ||
git config --global core.autocrlf false | ||
git config --global user.name "Create React App" | ||
git config --global user.email "cra@email.com" | ||
displayName: 'Initialize Git config settings' | ||
|
||
- checkout: self | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(NODE_VERSION) | ||
displayName: 'Install Node.js' | ||
|
||
- script: yarn --frozen-lockfile | ||
displayName: 'Install packages' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# | ||
# Azure Pipelines configuration for building and testing create-react-app on Linux, Windows, and macOS. | ||
# | ||
|
||
trigger: | ||
- master | ||
|
||
variables: | ||
CI: true | ||
VSTS_OVERWRITE_TEMP: True | ||
|
||
# ****************************************************************************** | ||
# Simple test suite | ||
# ****************************************************************************** | ||
jobs: | ||
- job: Simple | ||
strategy: | ||
matrix: | ||
LinuxNode8: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 8.x } | ||
LinuxNode10: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 10.x } | ||
MacNode8: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 8.x } | ||
MacNode10: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 10.x } | ||
WindowsNode8: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 8.x } | ||
WindowsNode10: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 10.x } | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
steps: | ||
- template: .azure-pipelines-steps.yml | ||
- bash: tasks/e2e-simple.sh | ||
displayName: 'Run tests' | ||
|
||
# ****************************************************************************** | ||
# Installs test suite | ||
# ****************************************************************************** | ||
- job: Installs | ||
strategy: | ||
matrix: | ||
LinuxNode8: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 8.x } | ||
LinuxNode10: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 10.x } | ||
MacNode8: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 8.x } | ||
MacNode10: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 10.x } | ||
WindowsNode8: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 8.x } | ||
WindowsNode10: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 10.x } | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
variables: | ||
YARN_CACHE_FOLDER: $(Build.SourcesDirectory)/../yarn-cache | ||
steps: | ||
- template: .azure-pipelines-steps.yml | ||
- bash: tasks/e2e-installs.sh | ||
displayName: 'Run tests' | ||
|
||
# ****************************************************************************** | ||
# Kitchensink test suite | ||
# ****************************************************************************** | ||
- job: Kitchensink | ||
strategy: | ||
matrix: | ||
LinuxNode8: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 8.x } | ||
LinuxNode10: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 10.x } | ||
MacNode8: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 8.x } | ||
MacNode10: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 10.x } | ||
WindowsNode8: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 8.x } | ||
WindowsNode10: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 10.x } | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
steps: | ||
- template: .azure-pipelines-steps.yml | ||
- bash: tasks/e2e-kitchensink.sh | ||
displayName: 'Run tests' | ||
|
||
# ****************************************************************************** | ||
# Kitchensink Eject test suite | ||
# ****************************************************************************** | ||
- job: KitchensinkEject | ||
strategy: | ||
matrix: | ||
LinuxNode8: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 8.x } | ||
LinuxNode10: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 10.x } | ||
MacNode8: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 8.x } | ||
MacNode10: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 10.x } | ||
WindowsNode8: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 8.x } | ||
WindowsNode10: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 10.x } | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
steps: | ||
- template: .azure-pipelines-steps.yml | ||
- bash: tasks/e2e-kitchensink-eject.sh | ||
displayName: 'Run tests' | ||
|
||
# ****************************************************************************** | ||
# Behavior test suite | ||
# ****************************************************************************** | ||
- job: Behavior | ||
strategy: | ||
matrix: | ||
LinuxNode8: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 8.x } | ||
LinuxNode10: { VM_IMAGE: 'ubuntu-16.04', NODE_VERSION: 10.x } | ||
MacNode8: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 8.x } | ||
MacNode10: { VM_IMAGE: 'macOS-10.13', NODE_VERSION: 10.x } | ||
WindowsNode8: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 8.x } | ||
WindowsNode10: { VM_IMAGE: 'vs2017-win2016', NODE_VERSION: 10.x } | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
steps: | ||
- template: .azure-pipelines-steps.yml | ||
- bash: tasks/e2e-behavior.sh | ||
displayName: 'Run tests' | ||
|
||
# ****************************************************************************** | ||
# Old Node test suite | ||
# ****************************************************************************** | ||
- job: OldNode | ||
strategy: | ||
matrix: | ||
LinuxNode6: | ||
VM_IMAGE: 'ubuntu-16.04' | ||
MacNode6: | ||
VM_IMAGE: 'macOS-10.13' | ||
WindowsNode6: | ||
VM_IMAGE: 'vs2017-win2016' | ||
pool: | ||
vmImage: $(VM_IMAGE) | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: 6.x | ||
displayName: 'Install Node.js' | ||
- bash: tasks/e2e-old-node.sh | ||
displayName: 'Run tests' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ module.exports = (resolve, rootDir, isEjecting) => { | |
setupFilesAfterEnv: setupTestsFile ? [setupTestsFile] : [], | ||
testMatch: [ | ||
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', | ||
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}', | ||
'<rootDir>/src/**/*(*.)@(spec|test).{js,jsx,ts,tsx}', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See jestjs/jest#7914 for details. This change was needed because of a breaking change in Jest v24. |
||
], | ||
testEnvironment: 'jsdom', | ||
testURL: 'http://localhost', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,17 +16,17 @@ cd "$(dirname "$0")" | |
# http://unix.stackexchange.com/a/84980 | ||
temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` | ||
temp_module_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_module_path'` | ||
custom_registry_url=http://localhost:4873 | ||
original_npm_registry_url=`npm get registry` | ||
original_yarn_registry_url=`yarn config get registry` | ||
|
||
# Load Verdaccio-related functions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consolidated all Verdaccio related logic into one script that each of the e2e scripts now references (avoids a bunch of duplication). |
||
source verdaccio.sh | ||
|
||
function cleanup { | ||
echo 'Cleaning up.' | ||
ps -ef | grep 'verdaccio' | grep -v grep | awk '{print $2}' | xargs kill -9 | ||
ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -9 | ||
cd "$root_path" | ||
npm set registry "$original_npm_registry_url" | ||
yarn config set registry "$original_yarn_registry_url" | ||
# Restore the original NPM and Yarn registry URLs | ||
restoreRegistryUrls | ||
} | ||
|
||
# Error messages are redirected to stderr | ||
|
@@ -75,18 +75,8 @@ yarn | |
# First, publish the monorepo. | ||
# ****************************************************************************** | ||
|
||
# Start local registry | ||
tmp_registry_log=`mktemp` | ||
(cd && nohup npx verdaccio@3.8.2 -c "$root_path"/tasks/verdaccio.yaml &>$tmp_registry_log &) | ||
# Wait for `verdaccio` to boot | ||
grep -q 'http address' <(tail -f $tmp_registry_log) | ||
|
||
# Set registry to local registry | ||
npm set registry "$custom_registry_url" | ||
yarn config set registry "$custom_registry_url" | ||
|
||
# Login so we can publish packages | ||
(cd && npx npm-auth-to-token@1.0.0 -u user -p password -e user@example.com -r "$custom_registry_url") | ||
# Start the local NPM registry | ||
startVerdaccio "$root_path"/tasks/verdaccio.yaml | ||
|
||
# Publish the monorepo | ||
git clean -df | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
VSTS_OVERWRITE_TEMP
avoids test problems related to weirdness with "temp" path math (especially on Windows where the short and long file paths are different)