<commit_before># Standard build + test job

parameters:
  name: ''
  vmImage: ''
  container: ''
  buildType: 'RELEASE'
  threads: 2
  publish: false

jobs:

 - job: ${{ parameters.name }}_${{ parameters.buildType }}

   # We're seeing jobs take about an hour sometimes!
   timeoutInMinutes: 100

   ${{ if ne(parameters.container, '') }}:
      container: ${{ parameters.container }}

   pool:
     vmImage: ${{ parameters.vmImage }}

   variables:
     ARNOLD_ROOT: $(System.DefaultWorkingDirectory)/arnoldRoot
     DELIGHT: $(System.DefaultWorkingDirectory)/3delight
     BUILD_TYPE: ${{ parameters.buildType }}

   steps:

   # Provides $(buildName) and $(buildSourceCommit)
   - script: ./config/azure/setBuildVars.py
     displayName: 'Set Custom Variables'

   - script: |
       brew update &&
       brew install scons doxygen &&
       brew cask install xquartz inkscape
     displayName: 'Install Toolchain (Darwin)'
     condition: eq( variables['Agent.OS'], 'Darwin' )

   - script: |
       ./config/installDelight.sh &&
       ./config/installArnold.sh &&
       ./config/installDependencies.sh ./build
     displayName: 'Install Dependencies'
     env:
       ARNOLD_LOGIN: $(arnoldLogin)
       ARNOLD_PASSWORD: $(<PASSWORD>)
       AZURE: 1

   - script: |
       Xvfb :99 -screen 0 1280x1024x24 &
       metacity&
     displayName: 'Start X (Linux)'
     condition: eq( variables['Agent.OS'], 'Linux' )
     env:
       DISPLAY: :99.0

   - script: |
       echo BUILD_TYPE=${{ parameters.buildType }}
       g++ --version
       scons -j ${{ parameters.threads }} package ENV_VARS_TO_IMPORT=PATH BUILD_TYPE=${{ parameters.buildType }} DELIGHT_ROOT=$DELIGHT ARNOLD_ROOT=$ARNOLD_ROOT BUILD_DIR=./build INSTALL_DIR=./install/$(buildName) BUILD_CACHEDIR=sconsCache
     displayName: 'Build'
     env:
       DISPLAY: :99.0
       AZURE: 1

   - script: |
       ./install/$(buildName)/bin/gaffer test
     displayName: 'Test'
     env:
       DISPLAY: :99.0
       AZURE: 1
       USER: azureTestUser # ImageWriterTest requires $USER but by default Azure doesn't provide it

   - ${{ if eq(parameters.publish, true) }}:
     - script: |
         pip install --user azure-storage-blob PyGithub
         ./config/azure/publishBuild.py --archive ./install/$(buildName).tar.gz --repo $(Build.Repository.Name) --commit $(buildSourceCommit)
       displayName: "Publish Build"
       env:
         GITHUB_ACCESS_TOKEN: $(githubAccessToken)
         AZURE_ACCESS_TOKEN: $(azureBlobAccessToken)
<commit_msg>Azure : Only publish builds from PullRequests of Scheduled builds<commit_after># Standard build + test job

parameters:
  name: ''
  vmImage: ''
  container: ''
  buildType: 'RELEASE'
  threads: 2
  publish: false

jobs:

 - job: ${{ parameters.name }}_${{ parameters.buildType }}

   # We're seeing jobs take about an hour sometimes!
   timeoutInMinutes: 100

   ${{ if ne(parameters.container, '') }}:
      container: ${{ parameters.container }}

   pool:
     vmImage: ${{ parameters.vmImage }}

   variables:
     ARNOLD_ROOT: $(System.DefaultWorkingDirectory)/arnoldRoot
     DELIGHT: $(System.DefaultWorkingDirectory)/3delight
     BUILD_TYPE: ${{ parameters.buildType }}

   steps:

   # Provides $(buildName) and $(buildSourceCommit)
   - script: ./config/azure/setBuildVars.py
     displayName: 'Set Custom Variables'

   - script: |
       brew update &&
       brew install scons doxygen &&
       brew cask install xquartz inkscape
     displayName: 'Install Toolchain (Darwin)'
     condition: eq( variables['Agent.OS'], 'Darwin' )

   - script: |
       ./config/installDelight.sh &&
       ./config/installArnold.sh &&
       ./config/installDependencies.sh ./build
     displayName: 'Install Dependencies'
     env:
       ARNOLD_LOGIN: $(arnoldLogin)
       ARNOLD_PASSWORD: $(arnoldPassword)
       AZURE: 1

   - script: |
       Xvfb :99 -screen 0 1280x1024x24 &
       metacity&
     displayName: 'Start X (Linux)'
     condition: eq( variables['Agent.OS'], 'Linux' )
     env:
       DISPLAY: :99.0

   - script: |
       echo BUILD_TYPE=${{ parameters.buildType }}
       g++ --version
       scons -j ${{ parameters.threads }} package ENV_VARS_TO_IMPORT=PATH BUILD_TYPE=${{ parameters.buildType }} DELIGHT_ROOT=$DELIGHT ARNOLD_ROOT=$ARNOLD_ROOT BUILD_DIR=./build INSTALL_DIR=./install/$(buildName) BUILD_CACHEDIR=sconsCache
     displayName: 'Build'
     env:
       DISPLAY: :99.0
       AZURE: 1

   - script: |
       ./install/$(buildName)/bin/gaffer test
     displayName: 'Test'
     env:
       DISPLAY: :99.0
       AZURE: 1
       USER: azureTestUser # ImageWriterTest requires $USER but by default Azure doesn't provide it

   - ${{ if eq(parameters.publish, true) }}:
     - script: |
         pip install --user azure-storage-blob PyGithub
         ./config/azure/publishBuild.py --archive ./install/$(buildName).tar.gz --repo $(Build.Repository.Name) --commit $(buildSourceCommit)
       displayName: "Publish Build"
       condition: or( eq( variables['Build.Reason'], 'PullRequest' ), eq( variables['Build.Reason'], 'Schedule' ) )
       env:
         GITHUB_ACCESS_TOKEN: $(githubAccessToken)
         AZURE_ACCESS_TOKEN: $(azureBlobAccessToken)

{'fraction_non_alphanumeric': 0.12821991541714725, 'fraction_numerical': 0.011534025374855825, 'mean_word_length': 2.820117474302496, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2095787', 'n_tokens_mistral': 1701, 'n_tokens_neox': 1586, 'n_words': 372}