Skip to content
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

Post Migration - Split UT and IT in separate jobs #29

Merged
merged 5 commits into from
May 3, 2024
Merged
Changes from 1 commit
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
Next Next commit
Separate jobs for modules
  • Loading branch information
pablo committed May 3, 2024
commit 87e3e17336468c88e3778052c9212f5e71fd0710
45 changes: 42 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,46 @@ on:
env:
TEST_CASSANDRA_PWD: ${RANDOM}${RANDOM}${RANDOM}
jobs:
test-java:


test-transform:
runs-on: ubuntu-latest
#if: ${{ false }} # disable for now
#avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/')))
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Test transform module and aggregate surefire report
run: mvn test -Daggregate=true -Dtest=* -pl modevo-transform -am -Dmaven.test.failure.ignore=true -U --no-transfer-progress
- name: Additional aggregated junit report
uses: javiertuya/junit-report-action@v1
with:
surefire-files: "**/target/surefire-reports/TEST-*.xml"
report-dir: target/site

- name: Generate report checks
if: always()
uses: mikepenz/action-junit-report@v4.2.1
with:
check_name: "test-result"
report_paths: "**/surefire-reports/TEST-*.xml"
fail_on_failure: 'true'

- if: always()
name: Publish test report files
uses: actions/upload-artifact@v4
with:
name: "test-report-files"
path: |
target/site
**/target/site/jacoco/jacoco.xml
**/target/surefire-reports
test-script:
runs-on: ubuntu-latest
#if: ${{ false }} # disable for now
#avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot
Expand All @@ -33,7 +72,7 @@ jobs:
chmod u+x setup/wait-container-ready.sh && ./setup/wait-container-ready.sh test-cassandra 1 "Created default superuser role"
docker exec test-cassandra cqlsh localhost 9042 -u cassandra -p cassandra -f creationSchema.cql
- name: Test and aggregate surefire report
run: mvn test -Daggregate=true -Dmaven.test.failure.ignore=true -U --no-transfer-progress
run: mvn test -Daggregate=true -Dtest=* -pl modevo-script -am -Dmaven.test.failure.ignore=true -U --no-transfer-progress

- name: Additional aggregated junit report
uses: javiertuya/junit-report-action@v1
Expand All @@ -60,7 +99,7 @@ jobs:
**/target/surefire-reports

sonarqube:
needs: [test-java]
needs: [test-transform, test-script]
#if: ${{ false }} # disable for now
#This job fails when comming from a dependabot PR (can't read the sonarqube token for security reasons).
#Links to discussions and workaround at: https://github.com/giis-uniovi/samples-giis-template/issues/4
Expand Down
Loading