Skip to content
name: Upstream pretest
on:
push:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
enmr_PRs:
runs-on: windows-latest
outputs:
exec_list: ${{ steps.make_exec_list.outputs.exec_list }}
steps:
- name: git config
run: |
git config --global core.autocrlf false
git config --global --add url.https://github.com/.insteadOf "git@github.com:"
- name: checkout
uses: actions/checkout@main
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
.gitmodules
- name: make exec list
id: make_exec_list
run: |
foreach ($subm_key in git config --file .gitmodules --name-only --get-regexp '^submodule\..+\.url$') {
$subm_url = git config --file .gitmodules --get $subm_key
Write-Host "URL: $subm_url"
foreach ($ref_l in git ls-remote $subm_url 'refs/pull/*/merge') {
if ($ref_l -notmatch '^[0-9a-f]+\s+refs/pull/(\d+)/merge$') {
throw "Unexpected format: $ref_l"
}
$pr_num = $Matches[1]
#Write-Host "- Found PR $pr_num"
$exec_list += "$pr_num;$subm_url"
}
}
$json = $exec_list | ConvertTo-Json -Compress
Write-Host $json
echo "::set-output name=exec_list::$json"
pretest-each:
runs-on: windows-latest
needs: enmr_PRs
strategy:
fail-fast: false
matrix:
exec_node: ${{ fromJson(needs.enmr_PRs.outputs.exec_list) }}
steps:
- name: git config
run: |
$exec_node = "${{ matrix.exec_node }}"
$pr_num, $subm_url = $exec_node -split ';', 2
Write-Host "Testing PR#$pr_num from: $subm_url"
# git config --global core.autocrlf false
# git config --global user.name "sun pack bot"
# git config --global user.email "sunserega2@gmail.com"
# - name: checkout
# uses: actions/checkout@main
# with:
# token: ${{ secrets.PAT_TOKEN }}