-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (126 loc) · 6.94 KB
/
on commit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Pack and test
on:
push:
branches-ignore:
- 'win-pack-changes/*'
- 'ubuntu-pack-changes/*'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
pack-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- 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/f8f09106-6d86-41b5-83c8-02892bbb7f29/w_opencl_runtime_p_2023.1.0.46319.exe' -OutFile 'D:\igfx.exe'
7z x "D:\igfx.exe" -o"D:\igfx" -y
D:\igfx\w_opencl_runtime_p_2023.1.0.46319.msi /quiet
- name: Download and unpack Pascal compiler
run: |
Invoke-WebRequest -Uri 'https://github.com/SunSerega/pascalabcnet/releases/download/unstable/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
git config --global --add url.https://github.com/.insteadOf "git@github.com:"
$process = Start-Process -FilePath 'PackAll.exe' -ArgumentList '"Stages= FirstPack + 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) -or (git ls-files --others --exclude-standard)) {
Write-Host "Changes detected"
git checkout -B "win-pack-changes/$(git rev-parse --abbrev-ref HEAD)"
git add -A
git config --global user.name "sun pack bot"
git config --global user.email "sunserega2@gmail.com"
git commit -m "win changes"
git push -f --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"
} else {
Write-Host "No changes detected"
}
pack-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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/unstable/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"
git config --global --add url.https://github.com/.insteadOf "git@github.com:"
# TODO need mono anon pipes workaround
# mono "PackAll.exe" "Stages= FirstPack + 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) || $(git ls-files --others --exclude-standard) ]]; then
echo "Changes detected"
git checkout -B "ubuntu-pack-changes/$(git rev-parse --abbrev-ref HEAD)"
git add -A
git config --global user.name 'pack bot'
git config --global user.email 'sunserega2@gmail.com'
git commit -m "ubuntu changes"
git push -f --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"
else
echo "No changes detected"
fi
Trigger-dependant-rep-actions:
runs-on: ubuntu-latest
needs: [pack-win, pack-ubuntu]
steps:
- uses: actions/github-script@main
with:
github-token: ${{ secrets.PAT_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'SunSerega',
repo: 'OpenCL-test',
workflow_id: 'on commit.yaml',
ref: 'main',
});