name: $(BuildID)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
resources:
  containers:
  - container: linux-c-ubuntu-2204
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-2204:latest
  - container: linux-c-ubuntu-2004
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-2004:latest
  - container: linux-c-ubuntu-clang
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-clang:latest
  - container: linux-c-ubuntu-c-ares
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-c-ares:latest
  - container: linux-c-ubuntu-wolfssl
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-wolfssl:latest
  - container: linux-c-ubuntu-bearssl
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-bearssl:latest
  - container: linux-c-ubuntu-mbed
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-ubuntu-mbed:latest
  - container: linux-c-debian-buster
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/linux-c-debian-buster:latest
  - container: raspberrypi-c-buster
    endpoint: csdk-containers
    image: csdkcontainerregistry.azurecr.io/raspberrypi-c-buster:brown
jobs:
- job: checksubmodule
  displayName: Check Submodule
  pool:
    vmImage: 'ubuntu-20.04'
  steps:
  - script: |
      sudo apt-get update && apt-get install -y \
      curl \
      git \
      python-software-properties \
      build-essential \
      pkg-config
      sudo curl -sL https://deb.nodesource.com/setup_16.x | bash -
      sudo apt-get install -y nodejs
    displayName: 'Setup'
  - script: |
      npm install check_submodules
      node_modules/.bin/check_submodules . master
    displayName: 'Build'
- job: windowsx86
  displayName: Windows x86
  pool:
    name: 'sdk-c--win-vs2022'
  steps:
  - script: |
     if exist jenkins\windows_c.cmd (
      call jenkins\windows_c.cmd)
    displayName: 'Build'
  - script: |
      call jenkins\windows_c_VsDevCmd.cmd && cd cmake && ctest -T test --no-compress-output -C "Debug" -V -j 16 --schedule-random
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
  - task: ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
- job: windowsx64
  variables:
    CodeQL.Enabled: true
    CodeQL.Language: cpp
  pool:
    name: 'sdk-c--win-vs2022'
  displayName: 'Windows x64'
  steps:
  - script: |
     if exist jenkins\windows_c.cmd (
      call jenkins\windows_c.cmd --platform x64)
    displayName: 'Build'
  - script: |
      call jenkins\windows_c_VsDevCmd.cmd x64 && cd cmake && ctest -T test --no-compress-output -C "Debug" -V -j 16 --schedule-random
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
  - task: ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
- job: windowsdynamic
  displayName: Windows Dynamic
  pool:
    name: 'sdk-c--win-vs2022'
  steps:
  - script: |
     if exist jenkins\windows_c_build_as_dynamic.cmd (
      call jenkins\windows_c_VsDevCmd.cmd
      call jenkins\windows_c_build_as_dynamic.cmd)
    displayName: 'Build'
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
  - task: ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
- job: clang
  container: linux-c-ubuntu-clang
  pool:
      name: 'sdk-c--ubuntu-22'
  displayName: 'Linux Ubuntu Clang'
  steps:
  - script: |
     if [ -f "jenkins/ubuntu_clang.sh" ]
     then
      export OPENSSL_ia32cap=0x00000000
      sudo chmod -R 755 .
      sudo -E ./jenkins/ubuntu_clang.sh
     fi
    displayName: 'Build'
  - script: |
      cd cmake && sudo -E ../build_all/linux/run_tests.sh
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: ubuntu2004
  container: linux-c-ubuntu-2004
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'Linux Ubuntu 20.04'
  steps:
  - script: |
     if [ -f "jenkins/ubuntu_c.sh" ]
     then
      export OPENSSL_ia32cap=0x00000000
      sudo chmod -R 755 .
      sudo -E ./jenkins/ubuntu_c.sh
     fi
    displayName: 'Build'
  - script: |
      cd cmake && sudo -E ../build_all/linux/run_tests.sh
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: ubuntu2204
  container: linux-c-ubuntu-2204
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'Linux Ubuntu 22.04'
  steps:
  - script: |
     if [ -f "jenkins/ubuntu_c.sh" ]
     then
      export OPENSSL_ia32cap=0x00000000
      sudo chmod -R 755 .
      sudo -E ./jenkins/ubuntu_c.sh
     fi
    displayName: 'Build'
  - script: |
      cd cmake && sudo -E ../build_all/linux/run_tests.sh
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: linuxoptions
  displayName: 'Linux Ubuntu 20.04 with Options'
  container: linux-c-ubuntu-2004
  pool: 
      name: 'sdk-c--ubuntu-22'
  steps:
  - script: |
     if [ -f "jenkins/linux_c_option_test.sh" ]
     then
      sudo ./jenkins/linux_c_option_test.sh
     fi
    displayName: 'Build'
    condition: always()
- job: linux_installed_deps
  container: linux-c-ubuntu-2004
  pool: 
    name: 'sdk-c--ubuntu-22'
  displayName: 'Linux with Installed Deps'
  steps:
  - script: |
      export OPENSSL_ia32cap=0x00000000
      sudo chmod -R 755 .
      sudo -E ./jenkins/linux_install_deps.sh
    displayName: 'Build'
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
      IOT_DPS_INDIVIDUAL_X509_CERTIFICATE: $(IOTHUB-E2E-X509-ECC-CERT-BASE64)
      IOT_DPS_INDIVIDUAL_X509_KEY: $(IOTHUB-E2E-X509-ECC-PRIVATE-KEY-BASE64)
      IOT_DPS_INDIVIDUAL_REGISTRATION_ID: $(IOT-DPS-INDIVIDUAL-REGISTRATION-ID)
- job: cares
  container: linux-c-ubuntu-c-ares
  pool: 
    name: 'sdk-c--ubuntu-22'
  displayName: 'Linux with C-Ares'
  steps:
  - script: |
      sudo -E bash jenkins/linux_cares.sh
    displayName: 'Build'
  - script: |
      cd cmake && sudo -E ../build_all/linux/run_tests.sh
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
      IOT_DPS_INDIVIDUAL_X509_CERTIFICATE: $(IOTHUB-E2E-X509-ECC-CERT-BASE64)
      IOT_DPS_INDIVIDUAL_X509_KEY: $(IOTHUB-E2E-X509-ECC-PRIVATE-KEY-BASE64)
      IOT_DPS_INDIVIDUAL_REGISTRATION_ID: $(IOT-DPS-INDIVIDUAL-REGISTRATION-ID)
  - task: PublishTestResults@2
    displayName: 'Publish C Ares Results'
    inputs:
      testRunner: CTest
      testResultsFiles: '**/Test.xml'
      mergeTestResults: true
      testRunTitle: 'cares'
    condition: succeededOrFailed()
- job: debian
  container: linux-c-debian-buster
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'Linux Debian (Buster)'
  steps:
  - script: |
     if [ -f "jenkins/debian_c.sh" ]
     then
      sudo chmod 755 jenkins/debian_c.sh
      sudo -E ./debian_c.sh
      sudo jenkins/debian_c.sh
     fi
    displayName: 'Build'
  - script: |
      cd cmake && sudo -E ../build_all/linux/run_tests.sh
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: linux_mbed
  container: linux-c-ubuntu-mbed
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'mbedTLS'
  steps:
  - script: |
     chmod +x jenkins/linux_mbed_clang_buildonly.sh
     ./jenkins/linux_mbed_clang_buildonly.sh
    displayName: 'Clang Build'
  - script: |
      if [ -f "jenkins/debian_c.sh" ]
      then
        sudo chmod 755 jenkins/linux_mbed.sh
        sudo -E ./jenkins/linux_mbed.sh
      fi
    displayName: 'Build'
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: wolfssl
  container: linux-c-ubuntu-wolfssl
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'WolfSSL'
  steps:
  - script: |
     chmod +x jenkins/linux_wolfssl_clang_buildonly.sh
     ./jenkins/linux_wolfssl_clang_buildonly.sh
    displayName: 'Clang Build'
  - script: |
     cmake --version
     cc --version
     gcc --version
     make --version
     if [ -f "jenkins/linux_wolfssl.sh" ]
     then
      LD_LIBRARY_PATH=/usr/local/lib
      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
      sudo jenkins/linux_wolfssl.sh
     fi
    displayName: 'Build'
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: bearssl
  container: linux-c-ubuntu-bearssl
  pool: 
      name: 'sdk-c--ubuntu-22'
  displayName: 'BearSSL'
  steps:
  - script: |
     chmod +x jenkins/linux_bearssl_clang_buildonly.sh
     ./jenkins/linux_bearssl_clang_buildonly.sh
    displayName: 'Clang Build'
  - script: |
      LD_LIBRARY_PATH=/usr/local/lib
      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
      cd $(Build.SourcesDirectory)
      bearsslDir=/beary
      export bearsslDir
      sudo bash jenkins/linux_bearssl.sh
    displayName: 'Build'
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
- job: OSX
  displayName: OSX
  pool:
    vmImage: 'macOS-13'
  steps:
  - script: |
     if [ -f "jenkins/osx_gcc_openssl.sh" ]
     then
      ./jenkins/osx_gcc_openssl.sh
     fi
    displayName: 'Build'
  - script: |
      cd cmake && ctest -T test --no-compress-output -C "Debug" -V -j 8 --schedule-random
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
  - task: ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
    condition: always()
- job: xcodenative
  displayName: XCode Native
  pool:
    vmImage: 'macOS-13'
  steps:
  - script: |
     if [ -f "jenkins/osx_xcode_native.sh" ]
     then
      DYLD_LIBRARY_PATH=/usr/local/Cellar/curl/7.61.0/lib
      ./jenkins/osx_xcode_native.sh
     fi
    displayName: 'Build'
  - script: |
      export DYLD_LIBRARY_PATH=/usr/local/Cellar/curl/7.61.0/lib
      cd cmake && ctest -T test --no-compress-output -C "Debug" -V -j $TEST_JOB_COUNT --schedule-random
    displayName: "Run Tests"
    env:
      IOTHUB_CONNECTION_STRING: $(IOTHUB-CONNECTION-STRING)
      IOTHUB_EVENTHUB_CONNECTION_STRING: $(IOTHUB-EVENTHUB-CONNECTION-STRING)
      IOTHUB_E2E_X509_CERT_BASE64: $(IOTHUB-E2E-X509-CERT-BASE64)
      IOTHUB_E2E_X509_PRIVATE_KEY_BASE64: $(IOTHUB-E2E-X509-PRIVATE-KEY-BASE64)
      IOTHUB_E2E_X509_THUMBPRINT: $(IOTHUB-E2E-X509-THUMBPRINT)
      IOTHUB_POLICY_KEY: $(IOTHUB-POLICY-KEY)
      IOTHUB_PARTITION_COUNT: $(IOTHUB-PARTITION-COUNT)
      STORAGE_ACCOUNT_CONNECTION_STRING: $(STORAGE-ACCOUNT-CONNECTION-STRING)
      IOT_DPS_CONNECTION_STRING: $(IOT-DPS-CONNECTION-STRING)
      IOT_DPS_ID_SCOPE: $(IOT-DPS-ID-SCOPE)
      IOTHUB_CA_ROOT_CERT: $(IOTHUB-CA-ROOT-CERT)
      IOTHUB_CA_ROOT_CERT_KEY: $(IOTHUB-CA-ROOT-CERT-KEY)
      IOT_DPS_GLOBAL_ENDPOINT: $(IOT-DPS-GLOBAL-ENDPOINT)
      IOTHUB_DEVICE_CONN_STRING_INVALIDCERT: $(IOTHUB-DEVICE-CONN-STRING-INVALIDCERT)
      IOTHUB_CONN_STRING_INVALIDCERT: $(IOTHUB-CONN-STRING-INVALIDCERT)
      DPS_GLOBALDEVICEENDPOINT_INVALIDCERT: $(DPS-GLOBALDEVICEENDPOINT-INVALIDCERT)
      PROVISIONING_CONNECTION_STRING_INVALIDCERT: $(PROVISIONING-CONNECTION-STRING-INVALIDCERT)
  - task: ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
- job: raspberrypi
  displayName: Raspberry Pi
  container: raspberrypi-c-buster
  pool: 
    name: 'sdk-c--ubuntu-22'
  steps:
  - script: |
     chmod +x jenkins/raspberrypi_c_buster.sh
     ./jenkins/raspberrypi_c_buster.sh
    displayName: 'Build'
- job: DotNET
  displayName: .NET
  variables:
    CodeQL.Enabled: true
    CodeQL.Language: csharp
  pool: 
    vmImage: 'windows-latest'
  steps:
  - script: |
     dotnet build testtools\SerialPort\SerialPort.sln
    displayName: 'Build'
