Configure evaluation module in local environment #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, Market, GestaoHospital] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'maven' | |
- name: Launch Petstore | |
if: ${{ matrix.scope == 'Petstore' }} | |
working-directory: ./sut-petstore | |
run: | | |
mvn package -DskipTests=true -ntp | |
docker build -t swagger-petstore . | |
docker run -d -p 8081:8080 --name swagger-petstore swagger-petstore | |
chmod u+x ../setup/wait-container-ready.sh | |
../setup/wait-container-ready.sh swagger-petstore "public ResponseContext findPetsByCategoryAndStatus" | |
- name: Launch Market | |
if: ${{ matrix.scope == 'Market' }} | |
working-directory: ./sut-market | |
run: | | |
mvn package -DskipTests=true -ntp | |
docker build -t market-rest --build-arg module=market-rest . | |
docker build -t market-web --build-arg module=market-web . | |
docker-compose -f docker-compose.yaml up -d | |
chmod u+x ../setup/wait-container-ready.sh | |
../setup/wait-container-ready.sh db "ready for start up" | |
../setup/wait-container-ready.sh market-rest "Started RestApplication" | |
- name: Launch GestaoHospital | |
if: ${{ matrix.scope == 'GestaoHospital' }} | |
working-directory: ./sut-gestaoHospital | |
run: | | |
mvn package -DskipTests=true -ntp | |
docker-compose up -d --force-recreate --build | |
chmod u+x ../setup/wait-container-ready.sh | |
../setup/wait-container-ready.sh mongodb "HospitalDB.product_collection" | |
../setup/wait-container-ready.sh gestaohospital "Started GestaohospitalarApplication" | |
- run: docker ps | |
- 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 All | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn test -pl st-tdg-test -Dtest=**/*${{ matrix.scope }}* -Dmaven.test.failure.ignore=true -U --no-transfer-progress | |
- if: ${{ matrix.scope == 'Petstore' }} | |
run: docker logs swagger-petstore > st-tdg-test/target/docker-petstore-server.log | |
- if: ${{ matrix.scope == 'Market' }} | |
run: | | |
docker logs market-rest > st-tdg-test/target/docker-market-server.log | |
docker logs db > st-tdg-test/target/docker-market-db.log | |
- if: ${{ matrix.scope == 'GestaoHospital' }} | |
run: | | |
docker logs gestaohospital > st-tdg-test/target/docker-gestaoHospital-server.log | |
docker logs mongodb > st-tdg-test/target/docker-gestaoHospital-db.log | |
- 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 |