onnxruntime/tools/ci_build/github/azure-pipelines/templates/mac-ci.yml
Yulong Wang 179406bd25
[JS] upgrade package-lock.json from v1 to v2 (#11039)
* upgrade package-lock.json from v1 to v2

* upgrade requirement of nodejs version to 16.x
2022-03-30 13:30:28 -07:00

93 lines
3.6 KiB
YAML

parameters:
JobName: 'MacOS_CI_Dev'
SubmoduleCheckoutMode: ''
BuildCommand: ''
DoNodejsPack: 'false'
DoNugetPack: 'false'
NuPackScript: ''
ArtifactName: 'drop-osx'
# Controls whether unreleased onnx opsets are allowed. Default is set to 1
AllowReleasedOpsetOnly: '1'
jobs:
- job: ${{ parameters.JobName }}
workspace:
clean: all
timeoutInMinutes: 150
pool:
vmImage: 'macOS-11'
variables:
BuildCommand: ${{ parameters.BuildCommand }}
ALLOW_RELEASED_ONNX_OPSET_ONLY: ${{ parameters.AllowReleasedOpsetOnly }}
MACOSX_DEPLOYMENT_TARGET: '10.14'
steps:
- checkout: self
${{ if ne(parameters.SubmoduleCheckoutMode, '') }}:
submodules: ${{ parameters.SubmoduleCheckoutMode }}
- task: UsePythonVersion@0
# Use python 3.8 to avoid build some of the required packages
displayName: Use Python 3.8
inputs:
versionSpec: 3.8
- task: NodeTool@0
inputs:
versionSpec: '16.x'
- script: |
set -e
pushd .
cd $(Build.SourcesDirectory)/cmake/external/protobuf
cmake ./cmake -DCMAKE_INSTALL_PREFIX=$(Build.BinariesDirectory)/protobuf -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Relwithdebinfo
make -j $(getconf _NPROCESSORS_ONLN)
make install
popd
export PATH=$(Build.BinariesDirectory)/protobuf/bin:$PATH
export ONNX_ML=1
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
sudo python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt'
sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer
${{ parameters.BuildCommand }}
displayName: 'Build and Test OnnxRuntime lib for MacOS'
- task: PublishTestResults@2
displayName: 'Publish unit test results'
inputs:
testResultsFiles: '**/*.results.xml'
searchFolder: '$(Build.BinariesDirectory)'
testRunTitle: 'Unit Test Run'
condition: succeededOrFailed()
- ${{ if eq(parameters['DoNugetPack'], 'true') }}:
- script: |
${{ parameters.NuPackScript }}
displayName: 'Copy MacOS libs to Artifact Staging'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
inputs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'
- ${{ if eq(parameters['DoNodejsPack'], 'true') }}:
# Esrp signing
#
# TODO: ESRP team is working on enable signing workflow on Mac. Should enable the following step when it's ready.
#
# - template: mac-esrp-dll.yml
# parameters:
# FolderPath: '$(Build.SourcesDirectory)/js/node/bin/napi-v3/darwin/x64'
# DisplayName: 'ESRP - Sign Node.js binding binaries'
# DoEsrp: ${{ parameters.DoEsrp }}
# Pattern: '*.dylib,*.node'
- script: |
cp -R $(Build.SourcesDirectory)/js/node/bin $(Build.ArtifactStagingDirectory)/bin
workingDirectory: '$(Build.SourcesDirectory)/js/node'
displayName: 'Create Node.js Binding Artifact'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
inputs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'
- template: component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- template: clean-agent-build-directory-step.yml