Skip to content

Commit

Permalink
Use template for Azure Pipelines builds (cake-contrib#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger authored Dec 17, 2024
1 parent 38c043b commit f6e9666
Show file tree
Hide file tree
Showing 30 changed files with 794 additions and 375 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build_script:

# Tests
test_script:
- ps: cd .\tests\script-runner\
- ps: cd .\tests\script-runner\net8.0\
- ps: .\build.ps1 --verbosity=diagnostic

#---------------------------------#
Expand Down
23 changes: 23 additions & 0 deletions .azuredevops/pipelines/templates/jobs/test-frosting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
- name: vmImage
type: string
- name: dotNetVersion
type: string

jobs:
- job: Test_Frosting_${{ replace(replace(parameters.vmImage,'-','_'),'.','_') }}_Net${{ parameters.dotNetVersion }}
displayName: Integration Tests Frosting ${{ parameters.vmImage }} (.NET ${{ parameters.dotNetVersion }})
dependsOn: Build
pool:
vmImage: '${{ parameters.vmImage }}'
steps:
- template: ../steps/prepare-test.yml
parameters:
dotNetVersion: ${{ parameters.dotNetVersion }}
- bash: |
./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net${{ parameters.dotNetVersion }}.0
displayName: 'Run integration tests'
- publish: $(Build.SourcesDirectory)/tests/frosting/net${{ parameters.dotNetVersion }}.0/build/BuildArtifacts/output
artifact: Integration Tests Frosting ${{ parameters.vmImage }} (.NET ${{ parameters.dotNetVersion }})
displayName: 'Publish generated reports as build artifact'
23 changes: 23 additions & 0 deletions .azuredevops/pipelines/templates/jobs/test-scripting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
- name: vmImage
type: string
- name: dotNetVersion
type: string

jobs:
- job: Test_Script_Runner_${{ replace(replace(parameters.vmImage,'-','_'),'.','_') }}_Net${{ parameters.dotNetVersion }}
displayName: Integration Tests Script Runner ${{ parameters.vmImage }} (.NET ${{ parameters.dotNetVersion }})
dependsOn: Build
pool:
vmImage: '${{ parameters.vmImage }}'
steps:
- template: ../steps/prepare-test.yml
parameters:
dotNetVersion: ${{ parameters.dotNetVersion }}
- bash: |
./build.sh --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net${{ parameters.dotNetVersion }}.0
displayName: 'Run integration tests'
- publish: $(Build.SourcesDirectory)/tests/script-runner/net${{ parameters.dotNetVersion }}.0/BuildArtifacts/output
artifact: Integration Tests Script Runner ${{ parameters.vmImage }} (.NET ${{ parameters.dotNetVersion }})
displayName: 'Publish generated reports as build artifact'
24 changes: 24 additions & 0 deletions .azuredevops/pipelines/templates/steps/prepare-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
parameters:
- name: dotNetVersion
type: string

steps:
- task: UseDotNet@2
inputs:
version: '${{ parameters.dotNetVersion }}.x'
displayName: 'Install .NET ${{ parameters.dotNetVersion }}'
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install NodeJs 20.x'
- script: |
npm install -g markdownlint-cli
displayName: 'Install required tools'
- download: current
artifact: NuGet Package
displayName: 'Download build artifact'
- task: CopyFiles@2
inputs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
name: NuGet Package
path: ./BuildArtifacts/Packages/NuGet/
# Integration Tests Script Runner Windows (.NET tool)
# Integration Tests Script Runner Windows 2019 (.NET 8)
Test_Windows_DotNetTool:
name: Integration Tests Script Runner Windows (.NET tool)
needs: Build
Expand All @@ -49,10 +49,10 @@ jobs:
8.x
- name: Run integration tests
run: ./build.ps1 --verbosity=diagnostic
working-directory: ./tests/script-runner/
working-directory: ./tests/script-runner/net8.0/
shell: powershell
- name: Publish generated reports as build artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: Integration Tests Script Runner Windows (.NET tool)
path: ./tests/script-runner/BuildArtifacts/output/
path: ./tests/script-runner/net8.0/BuildArtifacts/output/
Loading

0 comments on commit f6e9666

Please sign in to comment.