Skip to content

Merge pull request #643 from ansforge/dispatcher-poc-opentm-instrumen… #463

Merge pull request #643 from ansforge/dispatcher-poc-opentm-instrumen…

Merge pull request #643 from ansforge/dispatcher-poc-opentm-instrumen… #463

Workflow file for this run

name: Dispatcher CI
on:
push:
branches:
- main
paths:
- 'hub/dispatcher/**'
pull_request:
branches:
- '**'
paths:
- 'hub/dispatcher/**'
jobs:
coverage:
runs-on: ubuntu-latest
defaults:
run:
working-directory: hub/dispatcher
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: Check format
run: ./gradlew spotlessCheck
- name: Build and run tests
env:
# required to run tests because the whole build.gradle seems to be evaluated, even if the jib task is not executed
# so the GITHUB_TOKEN var must be resolved
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISPATCHER_TESTS_MODEL_VERSIONS: ${{ vars.DISPATCHER_TESTS_MODEL_VERSIONS }}
run: |
# test on each supported model lib version
for MODEL_VERSION in $DISPATCHER_TESTS_MODEL_VERSIONS; do
echo "🚀 Running dispatcher tests for model version $MODEL_VERSION"
./gradlew test -PmodelVersion=$MODEL_VERSION
done
- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.3
with:
paths: ${{ github.workspace }}/hub/dispatcher/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
dotnet-quality: 'ga'
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.1.23
with:
reports: ${{ github.workspace }}/hub/dispatcher/build/reports/jacoco/test/jacocoTestReport.xml
targetdir: coveragereport
security-scan:
uses: ./.github/workflows/security-scan.yml
with:
working-directory: 'hub/dispatcher'
project-type: 'java'
java-version: '21'
component-name: 'dispatcher'
scan-dockerfile: false