-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
33 lines (30 loc) · 896 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Run java test in a workflow
description: Run tests from a java project as part of your workflows.
inputs:
repo:
description: 'Repository URL where Java tests reside in'
required: true
branch:
description: 'Optional branch to target tests on a specific branch'
required: false
runs:
using: 'composite'
steps:
- name: Clone Java Repository
shell: bash
run: |
REPO_URL="${{ inputs.repo }}"
REPO_NAME=$(basename $REPO_URL .git)
echo "Repository Name: $REPO_NAME"
if [ -n "${{ inputs.branch }}" ]; then
git clone --branch ${{ inputs.branch }} $REPO_URL
else
git clone $REPO_URL
fi
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Run Java Tests
shell: bash
run: |
echo ${{ env.REPO_NAME }}
cd ${{ env.REPO_NAME }}
mvn clean test -ntp