Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A working Azure Pipelines for Java, Selenium, SauceLabs
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- main
pr:
- main
pool:
vmImage: 'ubuntu-latest'
#Set the environment variables for the pipeline.
# We create a variable sauce_user and assign it a value of $(SAUCE_USERNAME), which comes from the ADO
variables:
- name: sauce_user
value: $(SAUCE_USERNAME)
- name: sauce_key
value: $(SAUCE_ACCESS_KEY)
steps:
- bash: echo $SAUCE_USER
- bash: echo $SAUCE_KEY
#This will build and run the tests in the Maven project
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment