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

Clean up build pipelines #4995

Merged
merged 20 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 13 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Each package has its own **node_modules** directory that contains symbolic links
## Prerequisites

- [Git](https://git-scm.com/)
- [Node](https://nodejs.org/en/):an installation of the latest security patch of Node 18. The Node installation also includes the **npm** package manager.
- [Node](https://nodejs.org/en/): an installation of the latest security patch of Node 18. The Node installation also includes the **npm** package manager.
- [Rush](https://github.com/Microsoft/web-build-tools/wiki/Rush): to install `npm install -g @microsoft/rush`
- [TypeScript](https://www.typescriptlang.org/): this is listed as a devDependency, so if you're building it from source, you will get it with `rush install`.
- [Visual Studio Code](https://code.visualstudio.com/): an optional dependency, but the repository structure is optimized for its use
Expand Down Expand Up @@ -49,7 +49,7 @@ For incremental builds, the `rush build` command can be used to only build packa
3. Ensure linting passes when run locally: `rush lint`
4. Locally commit changes: `git commit` (or use the Visual Studio Code user interface)
5. Repeat steps 1-4 until ready to push changes
6. Check for API signature changes: `rush extract-api`. This will update the signature files, located in `common/api`. __Note:__ before doing this, first do the following:
6. Check for API signature changes: `rush extract-api`. This will update the signature files, located in `common/api`. **Note:** before doing this, first do the following:
- Be sure that your branch is up to date with the target branch (i.e. `git merge origin/master`)
- Cleanup your build output: `rush clean`
- Rebuild the project: `rush build`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
21 changes: 2 additions & 19 deletions common/config/azure-pipelines/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,14 @@ schedules:

jobs:
- job:
variables:
- name: linuxPool
value: "iModeljs Linux"
- name: mac_pool
value: iModelTechCI
- name: win_pool
value: iModelTechCI

strategy:
matrix:
"Windows_Node_18":
OS: windows-latest
platform: Windows_NT
name: $(win_pool)
"Linux_Node_18":
OS: ubuntu-latest
platform: Linux
name: $(linux_pool)
"MacOS_Node_18":
OS: macOS-latest
platform: Darwin
name: $(mac_pool)

pool:
vmImage: $(OS)
Expand All @@ -58,9 +44,6 @@ jobs:

steps:
- checkout: self
- template: ../templates/core-build.yaml
- template: ./templates/core-build.yaml
parameters:
name: Node_18
nodeVersion: 18.12.x
pool:
vmImage: $(OS)
nodeVersion: 18.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ variables:
- group: iModel.js Integration Test Users

jobs:
- job: Node_14_x
- job: Node_18_x
condition: succeeded()
pool:
vmImage: ubuntu-latest
steps:
- template: templates/integration-test-steps.yaml
parameters:
Node_Version: 14.x
nodeVersion: 18.x
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
steps:
- template: templates/integration-test-steps.yaml
parameters:
Node_Version: 18.x
nodeVersion: 18.x
22 changes: 6 additions & 16 deletions common/config/azure-pipelines/integration-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ trigger: none
pr: none

schedules:
- cron: "0 0 * * Sun"
displayName: Weekly Sunday build
branches:
include:
- master
- cron: "0 0 * * Sun"
displayName: Weekly Sunday build
branches:
include:
- master

variables:
- group: iTwin.js non-secret config variables
Expand All @@ -20,11 +20,7 @@ variables:
jobs:
- job: Integration_Tests_Full
strategy:
maxParallel: 3
matrix:
Linux_node_12_7:
imageName: ubuntu-latest
nodeVersion: 12.17.0
Linux_node_12_x:
imageName: ubuntu-latest
nodeVersion: 12.x
Expand All @@ -34,9 +30,6 @@ jobs:
linux_node_16_x:
imageName: ubuntu-latest
nodeVersion: 16.x
Windows_node_12_7:
imageName: windows-latest
nodeVersion: 12.17.0
Windows_node_12_x:
imageName: windows-latest
nodeVersion: 12.x
Expand All @@ -46,9 +39,6 @@ jobs:
Windows_node_16_x:
imageName: windows-latest
nodeVersion: 16.x
MacOS_node_12_7:
imageName: macos-latest
nodeVersion: 12.17.0
MacOS_node_12_x:
imageName: macos-latest
nodeVersion: 12.x
Expand All @@ -63,4 +53,4 @@ jobs:
steps:
- template: templates/integration-test-steps.yaml
parameters:
Node_Version: $(nodeVersion)
nodeVersion: $(nodeVersion)
7 changes: 2 additions & 5 deletions common/config/azure-pipelines/jobs/fast-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ jobs:
strategy:
matrix:
"Windows_Node_18":
OS: windows-latest
platform: Windows_NT
name: $(win_pool)
"Linux_Node_18":
OS: ubuntu-latest
platform: Linux
name: $(linux_pool)
"MacOS_Node_18":
OS: macOS-latest
platform: Darwin
name: $(mac_pool)

Expand All @@ -59,11 +56,11 @@ jobs:
clean: true
- template: ../templates/core-build.yaml
parameters:
nodeVersion: 18.12.x
nodeVersion: 18.x
buildIos: ${{ eq(variables['Agent.OS'], 'Darwin') }}
# Will run if even there is a failure somewhere else in the pipeline.
- template: ../templates/publish-test-results.yaml
parameters:
NodeVersion: 18.12.x
nodeVersion: 18.x
# The publish script identifies any new packages not previously published and tags the build
- template: ../templates/publish.yaml
35 changes: 10 additions & 25 deletions common/config/azure-pipelines/jobs/regression-testing.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# iTwin.js Core Regression Testing Build
#
# Tests all supported versions of iTwin.js on 3 main supported platforms; Windows 10, Ubuntu 20.04, and MacOS .
# Tests all supported versions of iTwin.js on 3 main supported platforms; Windows 10, Ubuntu 20.04, and MacOS.
#
# Starts with the minimum version (currently 12.20.0) and then follows the tip of each subsequent minor version.
# Starts with the minimum version (currently 12.20.0) and then follows the tip of each subsequent major LTS (even-numbered) version.
#
# The current LTS is tested in all normal CI/PR builds so no need to test it here.

Expand All @@ -19,7 +19,7 @@ schedules:
jobs:
- job:
variables:
- name: linuxPool
- name: linux_pool
value: "iModeljs Linux"
- name: mac_pool
value: iModelTechCI
Expand All @@ -28,21 +28,21 @@ jobs:

strategy:
matrix:
"Windows_Node_18":
"Windows_Node_18_12_0":
OS: windows-latest
platform: Windows_NT
name: $(win_pool)
node_version: 18.x
"Linux_Node_18":
node_version: 18.12.0
"Linux_Node_18_12_0":
OS: ubuntu-latest
platform: Linux
name: $(linux_pool)
node_version: 18.x
"MacOS_Node_18":
node_version: 18.12.0
"MacOS_Node_18_12_0":
OS: macOS-latest
platform: Darwin
name: $(mac_pool)
node_version: 18.x
node_version: 18.12.0

"Windows_Node_16":
OS: windows-latest
Expand Down Expand Up @@ -91,25 +91,10 @@ jobs:
platform: Darwin
name: $(mac_pool)
node_version: 12.x

"Windows_Node_12_22":
OS: windows-latest
platform: Windows_NT
name: $(win_pool)
node_version: 12.22.0
"Linux_Node_12_22":
OS: ubuntu-latest
platform: Linux
name: $(linux_pool)
node_version: 12.22.0
"MacOS_Node_12_22":
OS: macOS-latest
platform: Darwin
name: $(mac_pool)
node_version: 12.22.0
maxParallel: 3
aruniverse marked this conversation as resolved.
Show resolved Hide resolved

pool:
name: $(name)
demands:
- Agent.OS -equals $(platform)

Expand Down
4 changes: 2 additions & 2 deletions common/config/azure-pipelines/jobs/version-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
- checkout: self

- task: NodeTool@0
displayName: Use Node 12.x
displayName: Use Node 18.x
inputs:
versionSpec: 12.x
versionSpec: 18.x
checkLatest: true

- bash: |
Expand Down
5 changes: 3 additions & 2 deletions common/config/azure-pipelines/templates/core-build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This defines the core steps for building and validating iTwin.js Core

parameters:
- name: nodeVersion # name of the parameter; required
type: string # data type of the parameter; required

- name: workingDir
type: string
default: $(System.DefaultWorkingDirectory)
Expand All @@ -10,8 +13,6 @@ parameters:
- name: buildIos
type: boolean
default: false
- name: nodeVersion
default: ""
- name: currentBranch
default: $(Build.SourceBranch)
- name: targetBranch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
- name: Node_Version # name of the parameter; required
- name: nodeVersion # name of the parameter; required
type: string # data type of the parameter; required

steps:
Expand All @@ -10,9 +10,9 @@ steps:
- template: setup-integration-users.yaml

- task: NodeTool@0
displayName: "Use Node ${{ parameters.Node_Version }}"
displayName: "Use Node ${{ parameters.nodeVersion }}"
inputs:
versionSpec: "${{ parameters.Node_Version }}"
versionSpec: "${{ parameters.nodeVersion }}"
checkLatest: true

- script: "git config --local user.email imodeljs-admin@users.noreply.github.com"
Expand Down Expand Up @@ -66,7 +66,13 @@ steps:
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test
workingDirectory: "full-stack-tests/rpc"
displayName: "Run RPC Full Stack Tests"
condition: succeededOrFailed()
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))

# MacOS and Windows agents work without any virtual display
- script: npm run test
workingDirectory: "full-stack-tests/rpc"
displayName: "Run RPC Full Stack Tests"
condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux'))

- script: npm run test:integration
workingDirectory: "full-stack-tests/rpc-interface"
Expand All @@ -82,59 +88,72 @@ steps:
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration:frontend:ci
workingDirectory: "core/electron"
displayName: "Run Electron Frontend Tests"
condition: succeededOrFailed()
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))

# MacOS and Windows agents work without any virtual display
- script: npm run test:integration:frontend:ci
workingDirectory: "core/electron"
displayName: "Run Electron Frontend Tests"
condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux'))

# By default linux agents do not have a real display so use the virtual framebuffer
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npm run test:integration:backend
workingDirectory: "core/electron"
displayName: "Run Electron Backend Tests"
condition: succeededOrFailed()
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))

# MacOS and Windows agents work without any virtual display
- script: npm run test:integration:backend
workingDirectory: "core/electron"
displayName: "Run Electron Backend Tests"
condition: and(succeededOrFailed(), ne(variables['Agent.OS'], 'Linux'))

- task: PublishTestResults@2
displayName: "Publish Backend Test Results"
inputs:
testResultsFiles: "full-stack-tests/backend/lib/test/junit_results.xml"
testRunTitle: "Core - Backend Tests - ${{ parameters.Node_Version }}"
testRunTitle: "Core - Backend Tests - ${{ parameters.nodeVersion }}"
continueOnError: true
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish Core Integration Test Results"
inputs:
testResultsFiles: "full-stack-tests/core/lib/test/junit_results.xml"
testRunTitle: "Core - Integration Tests - ${{ parameters.Node_Version }}"
testRunTitle: "Core - Integration Tests - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish ECSchema Rpc Interface Integration Test Results"
inputs:
testResultsFiles: "full-stack-tests/ecschema-rpc-interface/ecschema-rpcinterface-tests-result/ecschema-rpcinterface-tests-result.xml"
testRunTitle: "ECSchema Rpc Interface - Integration Tests - ${{ parameters.Node_Version }}"
testRunTitle: "ECSchema Rpc Interface - Integration Tests - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish RPC Full Stack Test Results"
inputs:
testResultsFiles: "full-stack-tests/rpc/lib/test/junit_results.xml"
testRunTitle: "RPC Full Stack - ${{ parameters.Node_Version }}"
testRunTitle: "RPC Full Stack - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish Rpc Interface Integration Test Results"
inputs:
testResultsFiles: "full-stack-tests/rpc-interface/full_stack_test_results/full_stack_test_result.xml"
testRunTitle: "Rpc Interface - Integration Tests - ${{ parameters.Node_Version }}"
testRunTitle: "Rpc Interface - Integration Tests - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish Presentation Integration Test Results"
inputs:
testResultsFiles: full-stack-tests/presentation/lib/test/junit_results.xml
testRunTitle: "Presentation - Integration Tests - ${{ parameters.Node_Version }}"
testRunTitle: "Presentation - Integration Tests - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()

- task: PublishTestResults@2
displayName: "Publish Electron Test Results"
inputs:
testResultsFiles: core/electron/lib/test/*_junit_results.xml
testRunTitle: "Core - Electron Tests - ${{ parameters.Node_Version }}"
testRunTitle: "Core - Electron Tests - ${{ parameters.nodeVersion }}"
condition: succeededOrFailed()
Loading