From fb3c304099f4249c6b5912e96bb3adc32e4e31e5 Mon Sep 17 00:00:00 2001 From: Sun Serega Date: Sun, 18 Aug 2024 20:07:09 +0200 Subject: [PATCH] +69 - nice, start working on actual pretest --- .github/workflows/upstream pretest.yaml | 49 ++++++++++++++----------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/upstream pretest.yaml b/.github/workflows/upstream pretest.yaml index 2b7ccebe..ba498d6b 100644 --- a/.github/workflows/upstream pretest.yaml +++ b/.github/workflows/upstream pretest.yaml @@ -122,7 +122,7 @@ jobs: strategy: fail-fast: false matrix: - exec_data: ${{ fromJson(needs.enmr-PRs.outputs.exec_list) }} + exec-data: ${{ fromJson(needs.enmr-PRs.outputs.exec_list) }} steps: - name: git config @@ -133,26 +133,36 @@ jobs: git config --global user.email "sunserega2@gmail.com" git config --global --add url.https://github.com/.insteadOf "git@github.com:" - - name: checkout + - name: checkout main repo uses: actions/checkout@main + with: + path: './core' + fetch-depth: 0 - # - name: checkout subm fork - # uses: actions/checkout@main - # with: - # repository: 'SunSerega/OpenCL-Docs' - # ref: 'pretest/${{ matrix.exec_data.pr_num }}' - # path: './fork' - # token: ${{ secrets.POCGL_pretest_upstream_PAT }} + - name: checkout subm fork + uses: actions/checkout@main + with: + repository: ${{ matrix.exec-data.fork_repo }} + ref: 'pretest/${{ matrix.exec-data.pr_num }}' + path: './fork' + fetch-depth: 0 + token: ${{ secrets.POCGL_pretest_upstream_PAT }} - name: pretest run: | - $subm_url = "${{ matrix.exec_data.subm_url }}" - $pr_num = "${{ matrix.exec_data.pr_num }}" + $subm_url = "${{ matrix.exec-data.subm_url }}" + $pr_num = "${{ matrix.exec-data.pr_num }}" Write-Host "Testing PR $pr_num from: $subm_url" - # aaaaa + Push-Location './core' + git fetch + Pop-Location + + Push-Location './fork' + git fetch + Pop-Location remove-old-pretest: runs-on: windows-latest @@ -182,11 +192,6 @@ jobs: - name: remove old pretest branches run: | - # git config --unset remote.origin.url - # git config --unset remote.origin.fetch - - - function Split-OrEmpty { param ( $s ) if (-not $s) { return @() } @@ -204,9 +209,9 @@ jobs: New-Item -ItemType Directory -Path $main_repo_dir | Out-Null Push-Location $main_repo_dir $main_repo_url = '${{ github.server_url }}/${{ github.repository }}' - Write-Host "fetching commits of: $main_repo_url" + Write-Host "Cloning main repo: $main_repo_url" git clone --filter=tree:0 --no-progress --no-checkout $main_repo_url . - git branch -r + # git branch -r $core_removed_pr_nums = @() foreach ($pr_num in $core_pretest_pr_nums) { @@ -223,7 +228,7 @@ jobs: } if ($is_trivial) { Write-Host "Is trivial, removing..." - # git push origin --delete $branch_name + git push origin --delete $branch_name # BRANCH DELETE $core_removed_pr_nums += $pr_num } Write-Host '~~~~~' @@ -237,12 +242,12 @@ jobs: foreach ($pr_num in $subm_pretest_pr_nums) { - Write-Host "PR $pr_num was orphaned" + Write-Host "PR $pr_num was closed" if ($core_pretest_pr_nums -contains $pr_num) { Write-Host "But main repo is still referencing it" } else { Write-Host "Removing..." - # git push origin --delete "pretest/$pr_num" + git push origin --delete "pretest/$pr_num" # BRANCH DELETE } Write-Host '~~~~~' }