Skip to content

Read TaskPriorityClass from config (#872) #3125

Read TaskPriorityClass from config (#872)

Read TaskPriorityClass from config (#872) #3125

Workflow file for this run

# Copyright 2022 MONAI Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests & Sonarscanner/CodeCov
on:
pull_request:
push:
branches:
- 'develop'
workflow_dispatch:
env:
DOTNET_VERSION: '6.0.x'
jobs:
unit-tests-and-codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Enable NuGet cache
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore Solution
run: dotnet restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Build Solution
run: dotnet build -c Release --nologo --no-restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Run Unit Test
run: |
find ~+ -type f -name "*.Tests.csproj" | \
xargs -L1 dotnet test -v=minimal --results-directory "./results" \
--collect:"XPlat Code Coverage" --settings "./coverlet.runsettings"
working-directory: ./tests
- name: Archive code coverage results
uses: actions/[email protected]
with:
name: code-coverage-reports
path: ./tests/**/coverage.opencover.xml
workflow-executor-integration-tests:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:latest
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- 27017:27017
rabbit:
image: rabbitmq:3.8.18-management
env:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "admin"
RABBITMQ_DEFAULT_PASS: "admin"
RABBITMQ_DEFAULT_VHOST: "monaideploy"
ports:
- "15672:15672"
- "5672:5672"
minio:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install LivingDoc CLI
run: dotnet tool install --global SpecFlow.Plus.LivingDoc.CLI
- name: Enable NuGet cache
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore Solution
run: dotnet restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Build Solution
run: dotnet build -c Release --nologo --no-restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Run WorkflowExecutor Integration Tests
run: find ~+ -type f -name "*.WorkflowExecutor.IntegrationTests.csproj" | xargs -L1 dotnet test
working-directory: ./tests
- name: Generate LivingDoc HTML
if: always()
run: livingdoc test-assembly Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.dll -t TestExecution.json
working-directory: ./tests/IntegrationTests/WorkflowExecutor.IntegrationTests/bin/Debug/net6.0
- name: Publish report
if: always()
uses: actions/[email protected]
with:
name: WorkflowExecutorIntegrationTestReport
path: ./tests/IntegrationTests/WorkflowExecutor.IntegrationTests/bin/Debug/net6.0/LivingDoc.html
task-manager-integration-tests:
runs-on: ubuntu-latest
services:
mongo:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- 27017:27017
rabbit:
image: rabbitmq:3.8.18-management
env:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "admin"
RABBITMQ_DEFAULT_PASS: "admin"
RABBITMQ_DEFAULT_VHOST: "monaideploy"
ports:
- "15672:15672"
- "5672:5672"
minio:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install LivingDoc CLI
run: dotnet tool install --global SpecFlow.Plus.LivingDoc.CLI
- name: Enable NuGet cache
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore Solution
run: dotnet restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Build Solution
run: dotnet build -c Release --nologo --no-restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Run TaskManager Integration Tests
run: find ~+ -type f -name "*.TaskManager.IntegrationTests.csproj" | xargs -L1 dotnet test
working-directory: ./tests
- name: Generate LivingDoc HTML
if: always()
run: livingdoc test-assembly Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.dll -t TestExecution.json
working-directory: ./tests/IntegrationTests/TaskManager.IntegrationTests/bin/Debug/net6.0
- name: Publish report
if: always()
uses: actions/[email protected]
with:
name: TaskManagerIntegrationTestReport
path: ./tests/IntegrationTests/TaskManager.IntegrationTests/bin/Debug/net6.0/LivingDoc.html
sonarscanner:
runs-on: ubuntu-latest
needs: unit-tests-and-codecov
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Enable NuGet cache
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
run: dotnet tool install --global dotnet-sonarscanner
- name: Begin SonarScanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="../**/coverage.opencover.xml" /d:sonar.coverage.exclusions="src/WorkflowManager/Database/Repositories/**/*,src/TaskManager/Database/TaskDispatchEventRepository.cs,**/Migrations/M0*.cs"
working-directory: ./src
- name: Restore Solution
run: dotnet restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Build Solution
run: dotnet build -c Release --nologo --no-restore Monai.Deploy.WorkflowManager.sln
working-directory: ./src
- name: Download code coverage from unit tests
uses: actions/download-artifact@v3
with:
name: code-coverage-reports
- name: End SonarScanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
working-directory: ./src