Skip to content

Instantly share code, notes, and snippets.

@nadvolod
Created February 1, 2021 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadvolod/7e4b1a3d1d811d5adfb33939880dc60d to your computer and use it in GitHub Desktop.
Save nadvolod/7e4b1a3d1d811d5adfb33939880dc60d to your computer and use it in GitHub Desktop.
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