name: Compile on: workflow_dispatch: pull_request: push: branches: - dev - 1.10.x jobs: compile-dotnet: name: Compile .NET solution defaults: run: shell: pwsh runs-on: windows-latest steps: - name: Clone Repository uses: actions/checkout@v4.1.1 - 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 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 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 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: pwsh runs-on: windows-latest steps: - name: Clone Repository uses: actions/checkout@v4.1.1 - name: Setup NodeJS uses: actions/setup-node@v4.0.2 with: node-version: '7' - name: Setup NPM Packages working-directory: ./src run: | npm install --loglevel warn # 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: Rebuild Client-side Assets working-directory: ./src run: | gulp rebuild 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)) }