Skip to content

Instantly share code, notes, and snippets.

@jaydubb12
Last active August 11, 2022 19:40
Show Gist options
  • Save jaydubb12/d58175e7cdec30f5dd5c9e9d66beead7 to your computer and use it in GitHub Desktop.
Save jaydubb12/d58175e7cdec30f5dd5c9e9d66beead7 to your computer and use it in GitHub Desktop.
PIpeline that will build a maven project and run static analysis for all pull requests
# Build and perform static analysis
# Env tools - Maven 3.8.5 && Java 18
image: maven:3.8.5-openjdk-18-slim
pipelines:
pull-requests: # trigger event is a new || updated PR
'**': #this runs as default for any branch not elsewhere defined
- step:
name: Build front end & perform static analysis
caches:
- maven
script:
# runs build for frontend-ui module and backend services
- echo "Checking Maven / Java versions"
- mvn -v
- mvn install -Pstatic-analysis
after-script:
# Collect checkstyle results, if any, and convert to Bitbucket Code Insights.
- pipe: atlassian/checkstyle-report:0.3.1
variables:
CHECKSTYLE_RESULT_PATTERN: '.*/target/checkstyle-result.xml$'
REPORT_FAIL_SEVERITY: 'warn'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment