-
Notifications
You must be signed in to change notification settings - Fork 1
Set up Azure Pipelines #1
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
base: master
Are you sure you want to change the base?
Changes from all commits
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,85 @@ | ||
| # | ||
| # Azure Pipelines configuration for building and testing react on Linux, Windows, and macOS. | ||
| # | ||
|
|
||
| trigger: | ||
| - master | ||
|
|
||
| jobs: | ||
| - job: LinuxBasic | ||
| displayName: 'Linux: Basic Tests' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/linux/basic-tests.yml | ||
| - template: .azure-pipelines/common/publish-error-codes.yml | ||
| parameters: | ||
| artifactName: 'error-codes-linux-basic' | ||
|
|
||
| - job: LinuxProd | ||
| displayName: 'Linux: Prod Tests' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/linux/prod-tests.yml | ||
| - template: .azure-pipelines/common/publish-error-codes.yml | ||
| parameters: | ||
| artifactName: 'error-codes-linux-prod' | ||
|
|
||
| - job: LinuxFire | ||
| displayName: 'Linux: React Fire Tests' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/linux/fire-tests.yml | ||
| - template: .azure-pipelines/common/publish-error-codes.yml | ||
| parameters: | ||
| artifactName: 'error-codes-linux-react-fire' | ||
|
|
||
| - job: LinuxArtifacts | ||
| displayName: 'Linux: Build and Upload Artifacts' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/linux/build-and-upload-artifacts.yml | ||
| - template: .azure-pipelines/common/publish-error-codes.yml | ||
| parameters: | ||
| artifactName: 'error-codes-linux-build' | ||
|
|
||
| - job: LinuxCoverage | ||
| displayName: 'Linux: Test Coverage' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/linux/test-coverage.yml | ||
|
|
||
| - job: WindowsTests | ||
| displayName: 'Windows: Basic Tests' | ||
| pool: | ||
| vmImage: 'vs2017-win2016' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - template: .azure-pipelines/windows/basic-tests.yml | ||
| - template: .azure-pipelines/common/publish-error-codes.yml | ||
| parameters: | ||
| artifactName: 'error-codes-windows-basic' | ||
|
|
||
| - job: Lint | ||
| displayName: 'Lint' | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - template: .azure-pipelines/common/install.yml | ||
| - script: yarn lint | ||
| displayName: 'Run lint' | ||
|
|
||
| variables: | ||
| AZURE_PIPELINES_BRANCH: $(Build.SourceBranchName) | ||
| CI: true | ||
| CI_PULL_REQUEST: $[ eq( variables['Build.Reason'], 'PullRequest') ] | ||
| REPO_SLUG: $(Build.Repository.Name) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # | ||
| # Azure Pipelines setup configuration for react on Linux, Windows, and macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - script: | | ||
|
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. Since this step is only needed on Windows, you might move it to the WindowsTests job or into a Windows-specific step template that gets referenced from the WindowsTests job. (on Linux and macOS jobs, it's just unnecessary noise in the results/log) |
||
| git config core.autocrlf input | ||
| git reset HEAD --hard | ||
| displayName: 'Preserve LF endings on checkout' | ||
|
|
||
| - task: NodeTool@0 | ||
| inputs: | ||
| versionSpec: '10.x' | ||
| checkLatest: 'true' | ||
| displayName: 'Install Node.js' | ||
|
|
||
| - script: yarn --frozen-lockfile | ||
| displayName: 'Install packages' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # | ||
| # Azure Pipelines step to publish error code artifacts for react on Linux, Windows, and macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - task: PublishBuildArtifacts@1 | ||
| inputs: | ||
| pathtoPublish: './scripts/error-codes/codes.json' | ||
| artifactName: ${{ parameters.artifactName }} | ||
| displayName: 'Publish error-codes/codes.json' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # | ||
| # Azure Pipelines configuration for running tests and other checks on Linux/macOS. | ||
| # | ||
|
|
||
| steps: | ||
| # master branch is needed for Prettier step | ||
| - script: git fetch origin master:master | ||
| displayName: 'Fetch master branch' | ||
|
|
||
| - script: node ./scripts/prettier/index.js | ||
| displayName: 'Prettier' | ||
|
|
||
| - script: node ./scripts/tasks/flow-ci | ||
| displayName: 'Flow CI' | ||
|
|
||
| - script: | | ||
|
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. I'd switch this to |
||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-basic-linux.xml | ||
| yarn test --maxWorkers=2 | ||
| displayName: 'Run tests' | ||
|
|
||
| - script: ./scripts/circleci/check_license.sh | ||
|
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. They may balk at this (and suggest this gets done in a separate PR), but what about renaming
Owner
Author
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. Yeah, I was going to suggest it in the PR description but leave it out for now. |
||
| displayName: 'Check license' | ||
|
|
||
| - script: ./scripts/circleci/check_modules.sh | ||
| displayName: 'Check modules' | ||
|
|
||
| - script: ./scripts/circleci/test_print_warnings.sh | ||
| displayName: 'Test print warnings' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Basic' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-basic-linux.xml' | ||
| displayName: 'Publish test results to Azure Pipelines' | ||
| condition: succeededOrFailed() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # | ||
| # Azure Pipelines configuration for building and uploading artifacts on Linux/macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - script: ./scripts/circleci/add_build_info_json.sh | ||
| displayName: 'Add build info json' | ||
|
|
||
| - script: ./scripts/circleci/update_package_versions.sh | ||
| displayName: 'Update package versions' | ||
|
|
||
| - script: ./scripts/circleci/build.sh | ||
| displayName: 'Build' | ||
|
|
||
| - script: | | ||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-build-linux.xml | ||
| yarn test-build --maxWorkers=2 | ||
| displayName: 'Run build tests' | ||
|
|
||
| - script: | | ||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-build-prod-linux.xml | ||
| yarn test-build-prod --maxWorkers=2 | ||
| displayName: 'Run build prod tests' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Build' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-build-linux.xml' | ||
| displayName: 'Publish build test results to Azure Pipelines' | ||
| condition: succeededOrFailed() | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Build Prod' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-build-prod-linux.xml' | ||
| displayName: 'Publish build prod test results to Azure Pipelines' | ||
| condition: succeededOrFailed() | ||
|
|
||
| - script: node ./scripts/tasks/danger | ||
| displayName: 'Danger' | ||
|
|
||
| - script: ./scripts/circleci/upload_build.sh | ||
| displayName: 'Upload build' | ||
|
|
||
| - script: ./scripts/circleci/pack_and_store_artifact.sh | ||
| displayName: 'Pack artifacts' | ||
|
|
||
| - task: PublishBuildArtifacts@1 | ||
| inputs: | ||
| pathtoPublish: './node_modules.tgz' | ||
| artifactName: 'node_modules' | ||
| publishLocation: 'container' | ||
| displayName: 'Publish node_modules.tgz' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # | ||
| # Azure Pipelines configuration for running React Fire tests on Linux/macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - script: | | ||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-fire-linux.xml | ||
| yarn test-fire --maxWorkers=2 | ||
| displayName: 'Run Fire tests' | ||
|
|
||
| - script: | | ||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-fire-prod-linux.xml | ||
| yarn test-fire-prod --maxWorkers=2 | ||
| displayName: 'Run Fire prod tests' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Fire' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-fire-linux.xml' | ||
| displayName: 'Publish Fire test results to Azure Pipelines' | ||
| condition: succeededOrFailed() | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Fire Prod' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-fire-prod-linux.xml' | ||
| displayName: 'Publish Fire prod test results to Azure Pipelines' | ||
| condition: succeededOrFailed() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # | ||
| # Azure Pipelines configuration for running prod tests on Linux/macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - script: | | ||
| export JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-prod-linux.xml | ||
| yarn test-prod --maxWorkers=2 | ||
| displayName: 'Run prod tests' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Linux: Prod' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-prod-linux.xml' | ||
| displayName: 'Publish test results to Azure Pipelines' | ||
| condition: succeededOrFailed() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # | ||
| # Azure Pipelines configuration for running test coverage on Linux/macOS. | ||
| # | ||
|
|
||
| steps: | ||
| - script: ./scripts/circleci/test_coverage.sh | ||
| displayName: 'Test coverage' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # | ||
| # Azure Pipelines configuration for building and testing react on Windows. | ||
| # | ||
|
|
||
| steps: | ||
| - script: yarn build | ||
| displayName: 'Build' | ||
|
|
||
| - script: set JEST_JUNIT_OUTPUT=.azure-pipelines/test-results/test-basic-windows.xml&&yarn test | ||
|
kaylangan marked this conversation as resolved.
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. I've been setting the script: yarn test
env:
JEST_JUNIT_OUTPUT: '.azure-pipelines/test-results/test-basic-windows.xml' |
||
| displayName: 'Run tests' | ||
|
|
||
| # master branch is needed for Prettier step | ||
| - script: git fetch origin master:master | ||
| displayName: 'Fetch master branch' | ||
|
|
||
| - script: yarn prettier | ||
|
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. Any idea why prettier is invoked differently in Windows vs. Linux? In Linux, the step has this:
Owner
Author
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. I don't think it's intentional; more a side effect of having developed the AppVeyor and Circle processes separately.
Owner
Author
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. If anything...if we add |
||
| displayName: 'Prettier' | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testRunTitle: 'Windows: Basic' | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '.azure-pipelines/test-results/test-basic-windows.xml' | ||
| displayName: 'Publish test results to Azure Pipelines' | ||
| condition: succeededOrFailed() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,3 +23,5 @@ chrome-user-data | |
| .vscode | ||
| *.swp | ||
| *.swo | ||
| junit.xml | ||
| .azure-pipelines/test-results/ | ||
Uh oh!
There was an error while loading. Please reload this page.