Skip to content

Add run-commons-unit-tests.yml #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .github/workflows/run-auth-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ jobs:
uses: actions/checkout@v3

- name: Check if changes are in apps/auth
uses: dorny/paths-filter@v2
id: check_changes
run: |
git diff --name-only HEAD^..HEAD > files.txt
while IFS= read -r file
do
echo $file
if [[ $file != apps/auth/* ]]; then
echo "::set-output name=changed::false"
break
else
echo "::set-output name=changed::true"
fi
done < files.txt
with:
filters: |
changed:
- 'apps/auth/**'

- name: Set up JDK
uses: actions/setup-java@v3
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/run-commons-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Run commons Unit Tests

on:
pull_request:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check if changes are in apps/commons
uses: dorny/paths-filter@v2
id: check_changes
with:
filters: |
changed:
- 'apps/commons/**'

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Run Unit Tests for commons
if: steps.check_changes.outputs.changed == 'true'
working-directory: apps/commons
run: ./mvnw test