From 31d69ddd26d204963fae6ceeae4674a81cf5e1d8 Mon Sep 17 00:00:00 2001 From: Meee Date: Fri, 2 Feb 2024 08:53:31 +0700 Subject: [PATCH 1/2] CI: Merge all ci into one pr validation & install NET8 before buildling --- CI/azure-pipelines-linux.yml | 46 ------------------- CI/azure-pipelines-mac.yml | 45 ------------------ CI/job_templates/build_drawing_libraries.yml | 5 ++ ...ipelines-windows.yml => pr-validation.yml} | 14 +++++- 4 files changed, 18 insertions(+), 92 deletions(-) delete mode 100644 CI/azure-pipelines-linux.yml delete mode 100644 CI/azure-pipelines-mac.yml rename CI/{azure-pipelines-windows.yml => pr-validation.yml} (73%) diff --git a/CI/azure-pipelines-linux.yml b/CI/azure-pipelines-linux.yml deleted file mode 100644 index 5ff4383..0000000 --- a/CI/azure-pipelines-linux.yml +++ /dev/null @@ -1,46 +0,0 @@ -trigger: - branches: - include: - - main - - master - paths: - exclude: - - NuGet -pr: - branches: - include: - - master - - main - - develop - paths: - exclude: - - NuGet - - -pool: - vmImage: 'ubuntu-latest' - -variables: - - group: IronDrawingVersions - - name: buildConfiguration - value: 'Debug' - - name: AssemblyVersion - value: $(IronDrawingMajorVersion).$(IronDrawingMinorVersion).$(IronDrawingRevisionVersion).$(Build.BuildID) - -##### STEPS ##### -stages: -## Restore & Build IronDrawing and Publish Artifact -- stage: BuildDrawingLibraries - displayName: Build IronSoftware.Drawing Libraries - dependsOn: [] - jobs: - - template: job_templates/build_drawing_libraries.yml - parameters: - publishAssemblies: false - buildConfiguration: $(buildConfiguration) -## Execute Unit Tests -- template: stage_templates/run_tests_on_pool.yml - parameters: - OSPlatform: 'Ubuntu' - pool: - vmImage: 'ubuntu-latest' diff --git a/CI/azure-pipelines-mac.yml b/CI/azure-pipelines-mac.yml deleted file mode 100644 index 3dba54c..0000000 --- a/CI/azure-pipelines-mac.yml +++ /dev/null @@ -1,45 +0,0 @@ -trigger: - branches: - include: - - main - - master - paths: - exclude: - - NuGet -pr: - branches: - include: - - master - - main - - develop - paths: - exclude: - - NuGet - -pool: - vmImage: 'macOS-latest' - -variables: - - group: IronDrawingVersions - - name: buildConfiguration - value: 'Debug' - - name: AssemblyVersion - value: $(IronDrawingMajorVersion).$(IronDrawingMinorVersion).$(IronDrawingRevisionVersion).$(Build.BuildID) - -##### STEPS ##### -stages: -## Restore & Build IronDrawing and Publish Artifact -- stage: BuildDrawingLibraries - displayName: Build IronSoftware.Drawing Libraries - dependsOn: [] - jobs: - - template: job_templates/build_drawing_libraries.yml - parameters: - publishAssemblies: false - buildConfiguration: $(buildConfiguration) -## Execute Unit Tests -- template: stage_templates/run_tests_on_pool.yml - parameters: - OSPlatform: 'MacOs' - pool: - vmImage: 'macOS-latest' diff --git a/CI/job_templates/build_drawing_libraries.yml b/CI/job_templates/build_drawing_libraries.yml index a624468..9160f53 100644 --- a/CI/job_templates/build_drawing_libraries.yml +++ b/CI/job_templates/build_drawing_libraries.yml @@ -51,6 +51,11 @@ jobs: inputs: packageType: 'sdk' version: '7.x' + - task: UseDotNet@2 + displayName: 'Install .NET7 sdk' + inputs: + packageType: 'sdk' + version: '8.x' # Build - task: DotNetCoreCLI@2 displayName: Restore Solution NuGet Packages diff --git a/CI/azure-pipelines-windows.yml b/CI/pr-validation.yml similarity index 73% rename from CI/azure-pipelines-windows.yml rename to CI/pr-validation.yml index 7a74c57..012e89f 100644 --- a/CI/azure-pipelines-windows.yml +++ b/CI/pr-validation.yml @@ -38,9 +38,21 @@ stages: parameters: publishAssemblies: false buildConfiguration: $(buildConfiguration) -## Execute Unit Tests +## Execute Windows Unit Tests - template: stage_templates/run_tests_on_pool.yml parameters: OSPlatform: 'Windows' pool: vmImage: 'windows-latest' +## Execute Linux Unit Tests +- template: stage_templates/run_tests_on_pool.yml + parameters: + OSPlatform: 'Ubuntu' + pool: + vmImage: 'ubuntu-latest' +## Execute macOS Unit Tests +- template: stage_templates/run_tests_on_pool.yml + parameters: + OSPlatform: 'MacOs' + pool: + vmImage: 'macOS-latest' From 71028b405df91d484f30bdda7b6e72e90c4a6028 Mon Sep 17 00:00:00 2001 From: Meee Date: Tue, 6 Feb 2024 14:25:02 +0700 Subject: [PATCH 2/2] CI: Add checkmark to skip each tests --- CI/pr-validation.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CI/pr-validation.yml b/CI/pr-validation.yml index 012e89f..9514e33 100644 --- a/CI/pr-validation.yml +++ b/CI/pr-validation.yml @@ -16,6 +16,19 @@ pr: exclude: - NuGet +parameters: + - name: testWindows + displayName: Test Windows + type: boolean + default: True + - name: testLinux + displayName: Test Linux + type: boolean + default: True + - name: testMacOS + displayName: Test macOS + type: boolean + default: True pool: vmImage: 'windows-latest' @@ -44,15 +57,18 @@ stages: OSPlatform: 'Windows' pool: vmImage: 'windows-latest' + runUnitTests: ${{ parameters.testWindows }} ## Execute Linux Unit Tests - template: stage_templates/run_tests_on_pool.yml parameters: OSPlatform: 'Ubuntu' pool: vmImage: 'ubuntu-latest' + runUnitTests: ${{ parameters.testLinux }} ## Execute macOS Unit Tests - template: stage_templates/run_tests_on_pool.yml parameters: OSPlatform: 'MacOs' pool: vmImage: 'macOS-latest' + runUnitTests: ${{ parameters.testMacOS }}