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

[CI] Enhance the pipeline with git diff method #4737

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
178 changes: 50 additions & 128 deletions .ci/azure-pipelines/azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -1,163 +1,85 @@
# Exclude Rules:
# 1. path-filter in trigger and pr,
# this is NOT exclude rules for documentation,
# set this rule only to avoid any CI run.
# 2. DOCS_LISTS in diff script,
# the lists contains all documentation-related files,
# fill the list to help git-diff recognize docs changes.

trigger:
paths:
exclude:
- doc
- README.md
- CHANGES.md
- CONTRIBUTING.md
# add more exclude rules, e.g. .ci, .dev, .github
# which won't cause any CI to run.

pr:
paths:
exclude:
- doc
- README.md
- CHANGES.md
- CONTRIBUTING.md
# add more exclude rules, e.g. .ci, .dev, .github
# which won't cause any CI to run.

resources:
containers:
- container: fmt
- container: fmt # for formatting.yaml
image: pointcloudlibrary/fmt
- container: env1804
image: pointcloudlibrary/env:18.04
- container: env2004
image: pointcloudlibrary/env:20.04
- container: env2010
image: pointcloudlibrary/env:20.10

stages:
- stage: formatting
displayName: Formatting
jobs:
- template: formatting.yaml

- stage: build_gcc
displayName: Build GCC
dependsOn: formatting
- stage: diff
displayName: Code Changes Diff
jobs:
- job: ubuntu
displayName: Ubuntu
- job: codeDiff
displayName: Code Diff
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
18.04 GCC: # oldest LTS
CONTAINER: env1804
CC: gcc
CXX: g++
BUILD_GPU: ON
CMAKE_ARGS: '-DPCL_WARNINGS_ARE_ERRORS=ON'
20.10 GCC: # latest Ubuntu
CONTAINER: env2010
CC: gcc
CXX: g++
BUILD_GPU: OFF
# surface is not ready for re-entrant QHull
CMAKE_ARGS: '-DBUILD_tests_surface=OFF'
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra -Wnoexcept-type'
DISPLAY: :99.0 # Checked for in CMake
vmImage: 'ubuntu-latest'
steps:
- template: build/ubuntu.yaml
- checkout: self
- script: |
# Add all docs path to this array
DOCS_LISTS=("doc" "*.md")
for ENTRY in "${DOCS_LISTS[@]}"; do
DIFF_EXCLUDE="':(exclude)${ENTRY}' ${DIFF_EXCLUDE}"
done
cd $(Build.SourcesDirectory)
echo "##vso[task.setvariable variable=HasCodeChanges;isOutput=true]false"
# Show full git diff results
git diff $(git merge-base HEAD origin/test-CI-features)
# Set HasCodeChanges to true, if there's still file changed when excluding those docs
git diff --quiet $(git merge-base HEAD origin/test-CI-features) -- ${DIFF_EXCLUDE} || \
echo "##vso[task.setvariable variable=HasCodeChanges;isOutput=true]true"
name: GitResult
displayName: Show Git Diff Result

- stage: build_clang
displayName: Build Clang
dependsOn: formatting
- stage: documentation
displayName: Goto Documentation
dependsOn: diff
condition: and(succeeded(), eq(dependencies.diff.outputs['CodeDiff.GitResult.HasCodeChanges'], 'false'))
jobs:
- job: osx
displayName: macOS
pool:
vmImage: '$(VMIMAGE)'
strategy:
matrix:
Catalina 10.15:
VMIMAGE: 'macOS-10.15'
OSX_VERSION: '10.15'
Mojave 10.14:
VMIMAGE: 'macOS-10.14'
OSX_VERSION: '10.14'
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.WorkFolder)/build'
GOOGLE_TEST_DIR: '$(Agent.WorkFolder)/googletest'
CMAKE_CXX_FLAGS: '-Wall -Wextra -Wabi -Werror -Wno-error=deprecated-declarations'
steps:
- template: build/macos.yaml
- job: ubuntu
displayName: Ubuntu
# Placement of Ubuntu Clang job after macOS ensures an extra parallel job doesn't need to be created.
# Total time per run remains same since macOS is quicker so it finishes earlier, and remaining time is used by this job
# Therefore, number of parallel jobs and total run time of entire pipeline remains unchanged even after addition of this job
# The version of Ubuntu is chosen to cover more versions than covered by GCC based CI
dependsOn: osx
condition: succeededOrFailed()
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
20.04 Clang:
CONTAINER: env2004
CC: clang
CXX: clang++
BUILD_GPU: ON
CMAKE_ARGS: ''
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra'
DISPLAY: :99.0 # Checked for in CMake
steps:
- template: build/ubuntu.yaml
- job: ubuntu_indices
displayName: Ubuntu Indices
# Test 64 bit & unsigned indices
dependsOn: osx
condition: succeededOrFailed()
- job: prompt
displayName: Trigger Prompt
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
20.04 Clang:
CONTAINER: env2004
CC: clang
CXX: clang++
INDEX_SIGNED: OFF
INDEX_SIZE: 64
CMAKE_ARGS: ''
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra'
vmImage: 'ubuntu-latest'
steps:
- template: build/ubuntu_indices.yaml
- script: echo Trigger docs-pipeline.yaml...

- stage: build_msvc
displayName: Build MSVC
dependsOn: formatting
- stage: build
displayName: Goto Build
dependsOn: diff
condition: and(succeeded(), eq(dependencies.diff.outputs['CodeDiff.GitResult.HasCodeChanges'], 'true'))
jobs:
- job: vs2017
displayName: Windows VS2017 Build
- job: prompt
displayName: Trigger Prompt
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
x86:
PLATFORM: 'x86'
ARCHITECTURE: 'x86'
GENERATOR: 'Visual Studio 15 2017'
x64:
PLATFORM: 'x64'
ARCHITECTURE: 'x86_amd64'
GENERATOR: 'Visual Studio 15 2017 Win64'
timeoutInMinutes: 0
variables:
BUILD_DIR: 'c:\build'
CONFIGURATION: 'Release'
VCPKG_ROOT: 'C:\vcpkg'
vmImage: 'ubuntu-latest'
steps:
- template: build/windows.yaml
- script: echo Trigger build-pipeline.yaml...
150 changes: 150 additions & 0 deletions .ci/azure-pipelines/build-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
trigger: none

pr: none

resources:
pipelines:
- pipeline: Main-CI
source: Main
trigger:
stages:
- build
containers:
- container: env1804
image: pointcloudlibrary/env:18.04
- container: env2004
image: pointcloudlibrary/env:20.04
- container: env2010
image: pointcloudlibrary/env:20.10

stages:
- stage: build_gcc
displayName: Build GCC
dependsOn: []
jobs:
- job: ubuntu
displayName: Ubuntu
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
18.04 GCC: # oldest LTS
CONTAINER: env1804
CC: gcc
CXX: g++
BUILD_GPU: ON
CMAKE_ARGS: '-DPCL_WARNINGS_ARE_ERRORS=ON'
20.10 GCC: # latest Ubuntu
CONTAINER: env2010
CC: gcc
CXX: g++
BUILD_GPU: OFF
# surface is not ready for re-entrant QHull
CMAKE_ARGS: '-DBUILD_tests_surface=OFF'
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra -Wnoexcept-type'
DISPLAY: :99.0 # Checked for in CMake
steps:
- template: build/ubuntu.yaml

- stage: build_clang
displayName: Build Clang
dependsOn: []
jobs:
- job: osx
displayName: macOS
pool:
vmImage: '$(VMIMAGE)'
strategy:
matrix:
Catalina 10.15:
VMIMAGE: 'macOS-10.15'
OSX_VERSION: '10.15'
Mojave 10.14:
VMIMAGE: 'macOS-10.14'
OSX_VERSION: '10.14'
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.WorkFolder)/build'
GOOGLE_TEST_DIR: '$(Agent.WorkFolder)/googletest'
CMAKE_CXX_FLAGS: '-Wall -Wextra -Wabi -Werror -Wno-error=deprecated-declarations'
steps:
- template: build/macos.yaml
- job: ubuntu
displayName: Ubuntu
# Placement of Ubuntu Clang job after macOS ensures an extra parallel job doesn't need to be created.
# Total time per run remains same since macOS is quicker so it finishes earlier, and remaining time is used by this job
# Therefore, number of parallel jobs and total run time of entire pipeline remains unchanged even after addition of this job
# The version of Ubuntu is chosen to cover more versions than covered by GCC based CI
dependsOn: osx
condition: succeededOrFailed()
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
20.04 Clang:
CONTAINER: env2004
CC: clang
CXX: clang++
BUILD_GPU: ON
CMAKE_ARGS: ''
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra'
DISPLAY: :99.0 # Checked for in CMake
steps:
- template: build/ubuntu.yaml
- job: ubuntu_indices
displayName: Ubuntu Indices
# Test 64 bit & unsigned indices
dependsOn: osx
condition: succeededOrFailed()
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
20.04 Clang:
CONTAINER: env2004
CC: clang
CXX: clang++
INDEX_SIGNED: OFF
INDEX_SIZE: 64
CMAKE_ARGS: ''
container: $[ variables['CONTAINER'] ]
timeoutInMinutes: 0
variables:
BUILD_DIR: '$(Agent.BuildDirectory)/build'
CMAKE_CXX_FLAGS: '-Wall -Wextra'
steps:
- template: build/ubuntu_indices.yaml

- stage: build_msvc
displayName: Build MSVC
dependsOn: []
jobs:
- job: vs2017
displayName: Windows VS2017 Build
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
x86:
PLATFORM: 'x86'
ARCHITECTURE: 'x86'
GENERATOR: 'Visual Studio 15 2017'
x64:
PLATFORM: 'x64'
ARCHITECTURE: 'x86_amd64'
GENERATOR: 'Visual Studio 15 2017 Win64'
timeoutInMinutes: 0
variables:
BUILD_DIR: 'c:\build'
CONFIGURATION: 'Release'
VCPKG_ROOT: 'C:\vcpkg'
steps:
- template: build/windows.yaml
Loading