1- name : Tests
1+ name : Run Maven Tests
22
33on :
44 push :
1010 paths-ignore : ['*.md', 'CODEOWNERS', 'LICENSE']
1111
1212jobs :
13- # Runs the pom sorter and code formatter to ensure that the code
14- # is formatted and poms are sorted according to project rules. This
15- # will fail if the formatter makes any changes.
16- check-code-formatting :
17- runs-on : ubuntu-latest
18- steps :
19- - name : Checkout Code
20- uses : actions/checkout@v1
21- - name : Set up JDK 11
22- uses : actions/setup-java@v1
23- with :
24- java-version : 11
25- - uses : actions/cache@v1
26- with :
27- path : ~/.m2/repository
28- key : ${{ runner.os }}-maven-format-${{ hashFiles('**/pom.xml') }}
29- restore-keys : |
30- ${{ runner.os }}-maven-format-
31- ${{ runner.os }}-maven-
32- - name : Format code
33- run : |
34- mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -V -B -e clean formatter:format sortpom:sort -Pautoformat
35- git status
36- git diff-index --quiet HEAD || (echo "Error! There are modified files after formatting." && false)
37- env :
38- MAVEN_OPTS : " -Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"
39- USER_NAME : ${{ secrets.USER_NAME }}
40- ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
41-
42- # Build the code and run the unit/integration tests.
43- build-and-test :
44- runs-on : ubuntu-latest
45- steps :
46- - name : Checkout Code
47- uses : actions/checkout@v1
48- - name : Set up JDK 11
49- uses : actions/setup-java@v1
50- with :
51- java-version : 11
52- - uses : actions/cache@v1
53- with :
54- path : ~/.m2/repository
55- key : ${{ runner.os }}-maven-build-${{ hashFiles('**/pom.xml') }}
56- restore-keys : |
57- ${{ runner.os }}-maven-build-
58- ${{ runner.os }}-maven-format-
59- ${{ runner.os }}-maven-
60- - name : Build and Run Unit Tests
61- run : mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -V -B -e -Ddist clean verify
62- env :
63- MAVEN_OPTS : " -Dhttps.protocols=TLSv1.2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Djava.awt.headless=true"
64- USER_NAME : ${{ secrets.USER_NAME }}
65- ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
66-
67- # Here's an example of how you'd deploy the image to the github package registry.
68- # We don't want to do this by default since packages on github cannot be deleted
69- # or overwritten. So this could only be done for tags, however it seems the quickstart
70- # image may also exceed the maximum size allowed by github.
71- # - name: Image
72- # env:
73- # IMAGE_REGISTRY: "docker.pkg.github.com"
74- # IMAGE_USERNAME: "NationalSecurityAgency"
75- # USER_NAME: ${{ secrets.USER_NAME }}
76- # ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
77- # run: |
78- # # Set up env vars
79- # IMAGE_NAME=$(mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -q -N -Pdocker -f service/pom.xml -Dexec.executable='echo' -Dexec.args='${project.version}' exec:exec)
80- # IMAGE_PREFIX=$(mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -q -N -Pdocker -f service/pom.xml -Dexec.executable='echo' -Dexec.args='${docker.image.prefix}' exec:exec)
81- # IMAGE_TAG=$(mvn -s $GITHUB_WORKSPACE/.github/workflows/settings.xml -q -N -Pdocker -f service/pom.xml -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec)
82- # REMOTE_IMAGE_NAME="${IMAGE_REGISTRY}/${IMAGE_USERNAME}/${IMAGE_PREFIX}${IMAGE_NAME}"
83- # # Log in to the package registry
84- # echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com --username ${GITHUB_ACTOR} --password-stdin
85- # # Tag and push the image
86- # docker tag ${IMAGE_PREFIX}${IMAGE_NAME}:${IMAGE_TAG} ${REMOTE_IMAGE_NAME}:${IMAGE_TAG}
87- # docker push ${REMOTE_IMAGE_NAME}:${IMAGE_TAG}
13+ call-reusable-workflow :
14+ uses : nationalsecurityagency/datawave/.github/workflows/microservice-maven-tests.yaml@integration
0 commit comments