Skip to content

Commit 05a5c61

Browse files
committed
Updating workflows to use reusable
1 parent 5f4c3bc commit 05a5c61

File tree

2 files changed

+18
-76
lines changed

2 files changed

+18
-76
lines changed

.github/workflows/build-images.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Build and Push Image
2+
3+
on:
4+
push:
5+
paths-ignore: ['*.md', 'CODEOWNERS', 'LICENSE']
6+
tags:
7+
- "**"
8+
branches:
9+
- 'integration'
10+
- 'release/version*'
11+
- 'docker-images'
12+
workflow_dispatch:
13+
jobs:
14+
call-reusable-workflow:
15+
uses: nationalsecurityagency/datawave/.github/workflows/microservice-build-image.yaml@integration

.github/workflows/tests.yaml

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Run Maven Tests
22

33
on:
44
push:
@@ -10,78 +10,5 @@ on:
1010
paths-ignore: ['*.md', 'CODEOWNERS', 'LICENSE']
1111

1212
jobs:
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

Comments
 (0)