Реализовал ручной запуск тестов

This commit is contained in:
Антон Чичков 2025-01-17 15:39:43 +10:00
parent b76cc99613
commit 31000f7d9b
2 changed files with 8 additions and 16 deletions

View File

@ -1,25 +1,17 @@
param(
[Parameter(Mandatory=$true)] [string] $teamCityToken,
[Parameter(Mandatory=$true)] [string] $giteaToken,
[Parameter(Mandatory=$true)] [string] $pullId
[Parameter(Mandatory=$true)] [string] $branch,
[Parameter] [bool] $web
)
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
# Получим инфо о пулл-реквесте
$pull = Invoke-RestMethod -Uri https://sc.lers.ru/api/v1/repos/lers/LersUchet/pulls/$pullId -Headers @{Authorization = "token $giteaToken"}
$branch = $pull.head.ref
Write-Output "Starting tests in $branch"
& $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_FullTests"
& $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_ReleaseBuild"
$webLabel = $pull.labels | Where-Object { $_.name -eq "comp/Web" }
if ($webLabel)
if ($web)
{
Write-Host "Running web tests"
& $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_Tests_WebTests"

View File

@ -5,11 +5,11 @@ inputs:
teamcity-token:
description: 'Teamcity token'
required: true
gitea-token:
description: 'Gitea token token'
branch:
description: 'Branch'
required: true
pull-id:
description: 'Pull request id'
web:
description: 'Run web'
required: true
runs:
@ -17,4 +17,4 @@ runs:
steps:
- name: Start Teamcity tests
shell: powershell
run: ${{ gitea.action_path }}/Handle-PullRequestComment.ps1 -teamCityToken ${{ inputs.teamcity-token }} -giteaToken ${{ inputs.gitea-token }} -pullId ${{ inputs.pull-id }}
run: ${{ gitea.action_path }}/Handle-PullRequestComment.ps1 -teamCityToken ${{ inputs.teamcity-token }} -branch ${{ inputs.branch }} -web ${{ inputs.web }}