Skip to content

Commit

Permalink
Updated GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Jul 14, 2024
1 parent 8c433d6 commit 6cab06d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/uitest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ runs:
shell: bash
env:
DOTVVM_SAMPLES_CONFIG_PROFILE: ${{ inputs.samples-config }}
GITHUB_TOKEN: ${{ inputs.github-token }}

- if: ${{ runner.os == 'Windows' }}
run: choco install dotnet-aspnetcoremodule-v2 -y
Expand All @@ -53,6 +54,7 @@ runs:
shell: pwsh
env:
DOTVVM_SAMPLES_CONFIG_PROFILE: ${{ inputs.samples-config }}
GITHUB_TOKEN: ${{ inputs.github-token }}

# publish the result to github
- uses: ./.github/test-report
Expand Down
13 changes: 12 additions & 1 deletion .github/uitest/uitest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,16 @@ function Start-Sample {
[int][parameter(Position = 2)]$port
)
Invoke-RequiredCmds "Start sample '$sampleName'" {
Reset-IISServerManager -Confirm:$false

Remove-IISSite -Confirm:$false -Name $sampleName -ErrorAction SilentlyContinue

icacls "$root\artifacts\" /grant "IIS_IUSRS:(OI)(CI)F"

New-IISSite -Name "$sampleName" `
-PhysicalPath "$path" `
-BindingInformation "*:${port}:"

# ensure IIS created the site
while ($true) {
$state = (Get-IISSite -Name $sampleName).State
Expand All @@ -131,6 +133,15 @@ function Start-Sample {
throw "Site '${sampleName}' could not be started. State: '${state}'."
}
}

# add or update environment variable to the application pool
$existingEnvVar = c:\windows\system32\inetsrv\appcmd.exe list config -section:system.applicationHost/applicationPools `
| out-string `
| select-xml -XPath "//add[@name='DefaultAppPool']/environmentVariables/add[@name='GITHUB_TOKEN']"
if ($existingEnvVar -ne $null) {
c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /-"[name='DefaultAppPool'].environmentVariables.[name='GITHUB_TOKEN']" /commit:apphost
}
c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='DefaultAppPool'].environmentVariables.[name='GITHUB_TOKEN',value='$env:GITHUB_TOKEN']" /commit:apphost
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Samples/Owin/DotVVM.Samples.BasicSamples.Owin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
<PackageReference Include="Microsoft.Owin" Version="4.2.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Owin" Version="1.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/Samples/Owin/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"DotVVM.Samples.BasicSamples.Owin": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5407",
"applicationUrl": "http://localhost:5407",
"launchUrl": "http://localhost:65481/",
"applicationUrl": "http://localhost:65481/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
20 changes: 16 additions & 4 deletions src/Samples/Owin/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
</dependentAssembly>
</assemblyBinding>
Expand All @@ -49,9 +49,21 @@
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.4" newVersion="8.0.0.4" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>

0 comments on commit 6cab06d

Please sign in to comment.