@Library('xmos_jenkins_shared_library@v0.32.0') _

getApproval()

pipeline {
  agent none

  stages {
    stage('Application build') {
      parallel {
        stage('MacOS Intel') {
          agent {
            label 'macos && x86_64 && usb_audio'
          }
          steps {
            sh "cmake -B build -G Ninja"
            sh "ninja -C build"
          }
          post {
            cleanup {
              xcoreCleanSandbox()
            }
          }
        }
        stage('MacOS ARM') {
          agent {
            label 'macos && arm64'
          }
          steps {
            sh "cmake -B build -G Ninja"
            sh "ninja -C build"
          }
          post {
            cleanup {
              xcoreCleanSandbox()
            }
          }
        }
        stage('Windows') {
          agent {
            label 'windows && usb_audio'
          }
          steps {
            withVS() {
              sh "cmake -B build -G Ninja"
              sh "ninja -C build"
            }
          }
          post {
            cleanup {
              xcoreCleanSandbox()
            }
          }
        }
      }
    }
  }
}
