Skip to content

Pull upstream

Pull upstream #299

Workflow file for this run

name: Pack and test
on:
push:
schedule:
- cron: '0 0 * * *'
pull_request:
workflow_dispatch:
#concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: false
#
permissions:
contents: write
jobs:
update-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- run: |
git config --global core.autocrlf false
git config --global user.name "sun pack bot"
git config --global user.email "[email protected]"
git config --global --add url.https://github.com/.insteadOf "[email protected]:"
git fetch origin
for branch in $(git branch -r | grep 'origin/gh-pages/'); do
branch_name=$(echo $branch | sed 's#origin/gh-pages/##')
echo "Testing legacy branch [$branch]"
if ! git branch -r | grep -q "origin/$branch_name"; then
echo "Deleting legacy branch [$branch]"
git push origin --delete $(echo $branch | sed 's#origin/##')
fi
done
branch_name="gh-pages/$(git rev-parse --abbrev-ref HEAD)"
git checkout --orphan "$branch_name"
mv ".git" "Packing/Reference/0Release/"
cd "Packing/Reference/0Release/"
git add .
git commit -m "Split off gh-pages"
if git show-ref --verify --quiet refs/remotes/origin/$branch_name; then
echo "Remote branch $branch_name found"
if [ -z "$( git diff "origin/$branch_name" )" ]; then
echo "No difference with remote branch"
exit 0
else
echo "Difference found, recreating the branch"
fi
else
echo "Creating new remote branch"
fi
git push -f --set-upstream origin "$branch_name"
pack-win:
runs-on: windows-latest
steps:
- name: config
run: |
git config --global core.autocrlf false
git config --global user.name "sun pack bot"
git config --global user.email "[email protected]"
git config --global --add url.https://github.com/.insteadOf "[email protected]:"
- uses: actions/checkout@main
- name: Install OpenCL driver for Intel CPU
run: |
# https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html
Invoke-WebRequest -Uri 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0e6849e6-2c56-480b-afcf-be8331d5c4f6-opencl/w_opencl_runtime_p_2024.1.0.968.exe' -OutFile 'D:\igfx.exe'
7z x "D:\igfx.exe" -o"D:\igfx" -y
D:\igfx\w_opencl_runtime_p_2024.1.0.968.msi /quiet
- name: Download and unpack Pascal compiler
run: |
Invoke-WebRequest -Uri 'https://github.com/SunSerega/pascalabcnet/releases/download/custom-build-tag/PABCNETC.zip' -OutFile 'D:\PABCNETC.zip'
Expand-Archive -Path 'D:\PABCNETC.zip' -DestinationPath 'D:\PABCNETC' -Force
- name: PackAll
run: |
Get-ChildItem -Path .\* -Include *.log -Recurse | Remove-Item
Get-ChildItem -Path .\* -Include *.template -Recurse | Remove-Item
Write-Host "Compile: " -NoNewline
Start-Process -FilePath 'D:\PABCNETC\pabcnetcclear.exe' -ArgumentList '"PackAll.pas"' -Wait -NoNewWindow
$process = Start-Process -FilePath 'PackAll.exe' -ArgumentList '"Stages= PullUpstream + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=D:\PABCNETC\pabcnetcclear.exe" SkipFinishedPause' -NoNewWindow -PassThru -Wait
$exitCode = $process.ExitCode
if ($exitCode -ne 0) {
Write-Host "Exit code is not 0: $exitCode"
exit $exitCode
}
- name: Check for changes
run: |
git push origin --delete "win-pack-changes/$(git rev-parse --abbrev-ref HEAD)" > nul 2>&1
if ($?) {
Write-Host "Old changes branch deleted"
} else {
Write-Host "Old changes branch not found"
}
if ((git diff --name-only ":!LastPack.log") -or (git ls-files --others --exclude-standard)) {
Write-Host "Changes detected"
$workflow_fail = (git diff --name-only ":!LastPack.log" ":!Log/PullUpstream.log" ":!DataScraping/Reps") -or (git ls-files --others --exclude-standard)
git checkout -B "win-pack-changes/$(git rev-parse --abbrev-ref HEAD)"
git add -A
git commit -m "win changes"
git push -f --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"
if ($workflow_fail) {
Write-Host "Changes are not upstream-only, failing the workflow"
exit 1
}
} else {
Write-Host "No changes detected"
}
pack-ubuntu:
runs-on: ubuntu-latest
steps:
- name: config
run: |
git config --global core.autocrlf false
git config --global user.name "sun pack bot"
git config --global user.email "[email protected]"
git config --global --add url.https://github.com/.insteadOf "[email protected]:"
- uses: actions/checkout@main
- name: apt-gen update
run: sudo apt-get update
- name: Download Pascal Compiler
run: |
(
cd ../
curl -L -O https://github.com/SunSerega/pascalabcnet/releases/download/custom-build-tag/PABCNETC.zip
#file -i PABCNETC.zip
)
#7z -scsWIN -sccWIN x PABCNETC.zip -oPABCNETC
#unzip -j PABCNETC.zip -d PABCNETC
sudo apt-get install -y minizip
mkdir ../PABCNETC
miniunzip ../PABCNETC.zip -d ../PABCNETC
- name: Install Mono
run: |
sudo apt-get install -y mono-complete
#sudo apt-get install -y gdb lldb
- name: Install OpenCL Drivers
run: |
sudo apt-get install -y ocl-icd-opencl-dev
sudo apt-get install -y pocl-opencl-icd
- name: PackAll
run: |
#find . -name "*.log" -type f -delete
#find . -name "*.template" -type f -delete
mono "../PABCNETC/pabcnetcclear.exe" "PackAll.pas"
# TODO need mono anon pipes workaround
# mono "PackAll.exe" "Stages= PullUpstream + Reference + Dummy + OpenCL+OpenCLABC + OpenGL+OpenGLABC + Compile + Test + Release" "PasCompPath=../PABCNETC/pabcnetcclear.exe" SkipFinishedPause
- name: Check for changes
run: |
if git push origin --delete "ubuntu-pack-changes/$(git rev-parse --abbrev-ref HEAD)" &> /dev/null; then
echo "Old changes branch deleted"
else
echo "Old changes branch not found"
fi
if [[ $(git diff --name-only ":!LastPack.log") || $(git ls-files --others --exclude-standard) ]]; then
echo "Changes detected"
workflow_fail=$(git diff --name-only ":!LastPack.log" ":!Log/PullUpstream.log" ":!DataScraping/Reps") || $(git ls-files --others --exclude-standard)
git checkout -B "ubuntu-pack-changes/$(git rev-parse --abbrev-ref HEAD)"
git add -A
git commit -m "ubuntu changes"
git push -f --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"
if [ "$workflow_fail" ]; then
echo "Changes are not upstream-only, failing the workflow"
exit 1
fi
else
echo "No changes detected"
fi