Skip to content

Commit

Permalink
+69 - nice, start working on actual pretest
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Aug 18, 2024
1 parent 2209cbc commit fb3c304
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/upstream pretest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -133,26 +133,36 @@ jobs:
git config --global user.email "[email protected]"
git config --global --add url.https://github.com/.insteadOf "[email protected]:"
- 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
Expand Down Expand Up @@ -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 @() }
Expand All @@ -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) {
Expand All @@ -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 '~~~~~'
Expand All @@ -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 '~~~~~'
}
Expand Down

0 comments on commit fb3c304

Please sign in to comment.