Merge 1.10.x
into dev
#355
This file contains hidden or 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: Compile | |
# Compiles the solution and runs unit tests. | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- dev | |
- 1.10.x | |
jobs: | |
compile-dotnet: | |
name: Compile .NET solution | |
defaults: | |
run: | |
shell: cmd | |
runs-on: windows-2025 | |
steps: | |
- name: Clone Repository | |
uses: actions/[email protected] | |
- name: Restore NuGet Packages | |
run: nuget restore src/Orchard.sln | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Compile | |
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /p:MvcBuildViews=true | |
- name: Test | |
run: msbuild Orchard.proj /m /v:minimal /t:Test | |
- name: Test Setup with SpecFlow | |
shell: pwsh | |
run: | | |
$nunitConsole = (Get-ChildItem -Path 'src/packages' -Recurse -Filter 'nunit-console.exe' | Select-Object -Last 1).FullName | |
& $nunitConsole 'build/Compile/Orchard.Specs.dll' /xml='build/Orchard.Specs.xml' /run=Orchard.Specs.SetupFeature.RootAndSetupFolderShowsSetupScreenAndFormValuesAreValidated | |
- name: Run Orchard Setup with Orchard.exe | |
shell: pwsh | |
run: | | |
$commandFile = 'src/Orchard.Web/bin/setup-commands.txt' | |
New-Item -Path $commandFile -ItemType File -Force | |
Set-Content -Path $commandFile -Value 'setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:Password1! /DatabaseProvider:SqlCe /Recipe:Default' | |
& 'src/Orchard.Web/bin/Orchard.exe' @$commandFile | |
- name: Run Code Generation | |
shell: pwsh | |
run: | | |
$commandFile = 'src/Orchard.Web/bin/codegen-commands.txt' | |
New-Item -Path $commandFile -ItemType File -Force | |
Set-Content -Path $commandFile -Value @' | |
feature enable Orchard.CodeGeneration | |
codegen module Orchard.CodeGeneration.TestModule | |
codegen theme Orchard.CodeGeneration.TestTheme /CreateProject:true | |
codegen moduletests Orchard.CodeGeneration.TestModule | |
'@ | |
& 'src/Orchard.Web/bin/Orchard.exe' @$commandFile | |
- name: Compile Again with Generated Projects | |
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /NoWarn:CS2008 | |
compile-node: | |
name: Compile Client-side Assets | |
defaults: | |
run: | |
shell: cmd | |
runs-on: windows-2025 | |
steps: | |
- name: Clone Repository | |
uses: actions/[email protected] | |
- name: Setup NodeJS | |
uses: actions/[email protected] | |
with: | |
node-version: 7 | |
- name: Install Gulp Globally | |
working-directory: ./src | |
shell: pwsh | |
run: | | |
# Install gulp globally to be able to run the rebuild task, using the same version as in the project. | |
$gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp | |
Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn" | |
- name: Install NPM Packages | |
working-directory: ./src | |
run: npm install --loglevel warn | |
- name: Rebuild Client-side Assets | |
working-directory: ./src | |
run: gulp rebuild | |
- name: Check Client-side Assets | |
working-directory: ./src | |
shell: pwsh | |
run: | | |
git add . # To make line ending changes "disappear". | |
$gitStatus = (git status --porcelain) | |
if ($gitStatus) | |
{ | |
throw ("Client-side assets are not up-to-date. Please run 'gulp rebuild' and commit the changes.`n" + | |
[System.String]::Join([System.Environment]::NewLine, $gitStatus)) | |
} |