Skip to content

Commit

Permalink
Configure workflow (without SUTs)
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Jul 12, 2024
1 parent 75fb2e7 commit 1405d99
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: test-all
on:
push:
branches-ignore:
- 'dependabot/**' #avoid duplicates: only run the PR, not the commit
- 'gh-pages' #github pages do not trigger all tests
tags-ignore:
- 'v*' #avoid rerun existing commit on release
pull_request:
branches:
- 'main'

jobs:
test:
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/')))
strategy:
matrix:
scope: [Petstore]
fail-fast: false

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'

- name: Rules cache
id: rules-cache
uses: actions/[email protected]
with:
path: .tdrules-cache
key: cache-${{ matrix.scope }}-v1-${{ github.run_id }}
restore-keys: cache-${{ matrix.scope }}-v1-

- name: Test and aggregate surefire report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn test -pl st-tdg-test -Dtest=**/*Local* -Dmaven.test.failure.ignore=true -U --no-transfer-progress

- name: Generate report checks
if: always()
uses: mikepenz/[email protected]
with:
check_name: "test-result-${{ matrix.scope }}"
report_paths: "**/surefire-reports/TEST-*.xml"
fail_on_failure: 'true'

- name: Publish test report files
if: always()
uses: actions/upload-artifact@v4
with:
name: "test-report-files-${{ matrix.scope }}"
path: |
**/target/site
**/target/surefire-reports
**/target/*.html
**/target/*.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
.sonar
.tdrules-cache
TESTS-TestSuites.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected boolean isLiveBackend() {
* Gets the TdRules client used to obtain the FPC coverage rules
*/
protected TdRulesApi getRulesApi() {
return new TdRulesApi();
return new TdRulesApi().setCache("../.tdrules-cache");
}

/**
Expand Down

0 comments on commit 1405d99

Please sign in to comment.