| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| strategy: |
| matrix: |
| Ubuntu/Scala2.12: |
| imageName: 'ubuntu-16.04' |
| scalaVersion: '2.12.6' |
| Ubuntu/Scala2.11: |
| imageName: 'ubuntu-16.04' |
| scalaVersion: '2.11.12' |
| Windows/Scala2.12: |
| imageName: 'windows-2019' |
| scalaVersion: '2.12.6' |
| Windows/Scala2.11: |
| imageName: 'windows-2019' |
| scalaVersion: '2.11.12' |
| |
| variables: |
| # note that this adds the coverage option at the end so all sbt commands are |
| # built with code coverage enabled |
| sbt: sbt -J-Xms1024m -J-Xmx4096m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++$(scalaVersion) coverage |
| |
| pool: |
| vmImage: $(imageName) |
| |
| steps: |
| |
| ############################################################ |
| # Dependencies |
| ############################################################ |
| |
| - bash: echo "##vso[task.setvariable variable=sbtVersion]"$(grep sbt.version project/build.properties | cut -d= -f2) |
| displayName: Set SBT Version |
| |
| - bash: | |
| echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 |
| sudo apt-get -y update |
| sudo apt-get -y install rpm sbt=$(sbtVersion) |
| displayName: Install Dependencies (Linux) |
| continueOnError: false |
| condition: eq(variables['Agent.OS'], 'Linux') |
| |
| - bash: | |
| choco install sbt --version $(sbtVersion) |
| echo "##vso[task.prependpath]/c/Program Files (x86)/sbt/bin/" |
| displayName: Install Dependencies (Windows) |
| continueOnError: false |
| condition: eq(variables['Agent.OS'], 'Windows_NT') |
| |
| ############################################################ |
| # Build & Package |
| ############################################################ |
| |
| - bash: $(sbt) compile test:compile it:compile |
| displayName: Compile |
| continueOnError: false |
| |
| - bash: $(sbt) daffodil-japi/genjavadoc:doc daffodil-sapi/doc |
| displayName: Build Documentation |
| continueOnError: true |
| |
| - bash: $(sbt) daffodil-cli/universal:packageBin daffodil-cli/universal:packageZipTarball |
| displayName: Package Zip & Tar |
| continueOnError: true |
| |
| - bash: $(sbt) daffodil-cli/rpm:packageBin |
| displayName: Package RPM |
| continueOnError: true |
| condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) |
| |
| ############################################################ |
| # Tests |
| ############################################################ |
| |
| - bash: $(sbt) ratCheck || (cat target/rat.txt; exit 1) |
| displayName: Run Rat Check |
| continueOnError: true |
| |
| - bash: $(sbt) test |
| displayName: Run Unit Tests |
| continueOnError: true |
| |
| - bash: $(sbt) it:test |
| displayName: Run Integration Tests |
| continueOnError: true |
| |
| # Disabled for now until ASF support is enabled |
| #- bash: | |
| # $(sbt) coverageReport |
| # bash <(curl -s https://codecov.io/bash) |
| # displayName: Generate Coverage Report |
| # continueOnError: true |
| |
| - task: PublishTestResults@2 |
| displayName: Publish Test Results |
| inputs: |
| testRunner: JUnit |
| testResultsFiles: '**/TEST-*.xml' |