forked from jconway/plr
-
Notifications
You must be signed in to change notification settings - Fork 27
2724 lines (2373 loc) · 116 KB
/
buildPLRschedule.yml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: daily Meson Builds PL/R
run-name: daily Meson Builds PL/R - ${{ github.event.head_commit.message }}
on:
push:
pull_request:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 1 * * *'
# This is a PERFECT COPY of buildPLR.yml
# with the following exact exceptions.
# 1. The YAML items "name" and "run-name" is prefixed with the word "daily".
# 2. This has a YAML item "schedule".
# 3. This has exactly ONE matrix item . . .
# R bleeding edge and PostgreSQL bleeding edge (buildpgFromSRCmethod meson)
# 4. The ONE matrix items has set ( GithubActionsIgnoreFail false ).
# 5. Steps using actions/upload-artifact are COMMENTED out.
# 6. Steps using ncipollo/release-action are COMMENTED out.
jobs:
build_test_install:
name: matid ${{ matrix.matid }} R ${{ matrix.rversion }} PGsrc ${{ matrix.pgSRCversion }} PGbin ${{ matrix.pgWINversion }} ${{ matrix.compilerEnv }} ${{ matrix.Platform }} ${{ matrix.os }} ${{ matrix.Configuration }} R ${{ matrix.rversion }} PGSRC ${{ matrix.buildpgFromSRC }} PGSRCMETH ${{ matrix.buildpgFromSRCmethod }} SRCCTB ${{ matrix.buildpgANDplrInSRCcontrib }}
runs-on: ${{ matrix.os }}
# With "continue-on-error" (and with "fail-fast") emulate Appveyor "allow_failures"
# Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
continue-on-error: ${{ matrix.GithubActionsIgnoreFail }}
strategy:
# Disable fail-fast as we want results from all even if one fails.
fail-fast: false
matrix:
# Repository/Virtual_Machine PostgreSQL binaries are not known automatically.
# (See far below in the matrix.)
#
# In two matrix items, already-compiled repository found
# PostreSQL already compiled binaries are used.
#
# The repository PostgreSQL version in HERE
# is not [easily] detectable ahead of the build method.
# Therefore, a HUMAN, must often check and set the build matrix versions
# in the Github Actions build matrix, before the Github Action runs.
# (I do not yet have an [easy automated] work around.)
#
# Already-compiled PostgreSQL binaries in repositories in these places HERE.
#
# Type: Pull the binary from here.
# 1. https://packages.msys2.org/package/mingw-w64-ucrt-x86_64-postgresql
#
# Type: Build within this virtual machine with the installed binary here.
# 2. https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
# Note, I can not uninstall PostgreSQL for Windows. I tried.
# "next PostgreSQL" version is not known automatically.
#
# In the caseof "next PostgreSQL" (See far below in the matrix)
# a HUMAN must manually see the VERSION.
include:
## # Note, the x86 Cygwin Server will "not start" on Github Actions.
## # Therfore cygwin x86 is "not PostgreSQL regression testable."
## #
## # Repository R and Repository Postgresql
## # Package: R
## # https://www.cygwin.com/packages/summary/R.html
## # Package: postgresql
## # https://www.cygwin.com/packages/summary/postgresql.html
## #
## # current Cygwin repository
## - matid: 1
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: cygwin
## Platform: x64
## Configuration: Release
##
## # plr for "R 4.3.0 (and later) for Windows" can not be compiled with Microsoft Visual Studio.
## # Therefore, here, plr for "R 4.3.0 (and later) for Windows" is compiled with MSYS2(UCRT64/MINGW32).
## # It is regression tested twice.
## #
## # The first regression test is within PostgreSQL on MSYS2.
## #
## # The second regression test is within PostgreSQL that had been compiled with Microsoft Visual Studio
## # from EnterpriseDB (if available: master _RC* and _BETA* versions are often not available).
## #
## # Here are the reasons why plr for "R 4.3.0 (and later) for Windows"
## # can not be compiled with Microsoft Visual Studio.
## #
## # Bug 18544 - private_data_c Visual Studio 2022 R-4.3.0 Complex.h(81,21): syntax error: missing ';' before identifier 'private_data_c'
## # Status: CLOSED WONTFIX
## # https://bugs.r-project.org/show_bug.cgi?id=18544
## #
## # The new definition does not work with MSVC compilers because they don't support the C99 _Complex type
## # https://learn.microsoft.com/en-us/cpp/c-runtime-library/complex-math-support?view=msvc-170
## #
## # C Complex Numbers in C++?
## # https://stackoverflow.com/questions/10540228/c-complex-numbers-in-c
## #
# R bleeding edge and PostgreSQL bleeding edge (buildpgFromSRCmethod meson)
- matid: 2
os: windows-latest
GithubActionsIgnoreFail: false
compilerEnv: UCRT64
shellEnv: msys2 {0}
compilerExe: gcc
Platform: x64
Configuration: Debug
#
rversion: devel
R_HOME: 'D:\RINSTALL'
R_ARCH: /x64
#
pgSRCversion: master
PG_SOURCE: 'D:\PGSOURCE'
buildpgFromSRC: true
buildpgFromSRCmethod: meson
PG_HOME: 'D:\PGINSTALL'
## # R latest and PostgreSQL bleeding edge (buildpgFromSRCmethod meson)
## - matid: 3
## os: windows-latest
## GithubActionsIgnoreFail: true
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Debug
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: master
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgFromSRC: true
## buildpgFromSRCmethod: meson
## PG_HOME: 'D:\PGINSTALL'
##
##
## # R latest and PostgreSQL bleeding edge (buildpgANDplrInSRCcontrib true)
## - matid: 4
## os: windows-latest
## GithubActionsIgnoreFail: true
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Debug
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## # A HUMAN must manually see the VERSION here. (seen Jul 13 2024 EST)
## # Because this is "next PostgreSQL",
## # if available are/is 'release candidate' REL_AA_RC#
## # and/or 'beta' REL_AA_BETA# version(s)
## # then choose that 'latest' version;
## # 'REL' is later than 'BETA'. Higher numbers are later than lower numbers.
## # Otherwise, just choose the latest REL_XX_Y or better just REL_XX_STABLE
## # https://github.com/postgres/postgres/tags
## pgSRCversion: master
## PG_SOURCE: 'D:\PGSOURCE'
## #
## # buildpgFromSRC: true
## # buildpgFromSRCmethod: make/meson(PostgreSQL 16+)
## # Add meson build system (Andres Freund, Nazir Bilal Yavuz, Peter Eisentraut)
## # https://www.postgresql.org/docs/16/release-16.html
## # xor
## # buildpgANDplrInSRCcontrib: true
## buildpgANDplrInSRCcontrib: true
## PG_HOME: 'D:\PGINSTALL'
##
##
## # R bleeding edge and PostgreSQL latest (buildpgFromSRCmethod meson)
## - matid: 5
## os: windows-latest
## GithubActionsIgnoreFail: true
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Debug
## #
## rversion: devel
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_17_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgFromSRC: true
## buildpgFromSRCmethod: meson
## PG_HOME: 'D:\PGINSTALL'
## #
## # pgWINversion: REL_X_Y.future-future
## #
## # not "MSYS2testonpgWIN: true" - because no existing "PostgreSQL REL_X_Y for Windows" exists anywhere.
## #
## # This may not be available if pgSRCversion is 'RC' or 'BETA'.
## # pgWINversion: x.y-z
## # This may not be available if pgSRCversion is 'RC' or 'BETA'.
## # MSYS2testonpgWIN: true
## pgWINversion: 17.0-1
## MSYS2testonpgWIN: true
##
##
## # R latest and PostgreSQL latest (buildpgFromSRCmethod meson)
## - matid: 6
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Release
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_17_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgFromSRC: true
## buildpgFromSRCmethod: meson
## PG_HOME: 'D:\PGINSTALL'
## #
## pgWINversion: 17.0-1
## MSYS2testonpgWIN: true
##
##
## # R latest and PostgreSQL latest (buildpgANDplrInSRCcontrib true)
## - matid: 7
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Release
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_17_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgANDplrInSRCcontrib: true
## PG_HOME: 'D:\PGINSTALL'
## #
## pgWINversion: 17.0-1
## MSYS2testonpgWIN: true
##
##
## - matid: 8
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Release
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_16_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgANDplrInSRCcontrib: true
## PG_HOME: 'D:\PGINSTALL'
## #
## pgWINversion: 16.4-1
## MSYS2testonpgWIN: true
##
##
## - matid: 9
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Release
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_15_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgFromSRC: true
## buildpgFromSRCmethod: make
## PG_HOME: 'D:\PGINSTALL'
## #
## pgWINversion: 15.8-1
## MSYS2testonpgWIN: true
##
##
## - matid: 10
## os: windows-latest
## GithubActionsIgnoreFail: false
## compilerEnv: UCRT64
## shellEnv: msys2 {0}
## compilerExe: gcc
## Platform: x64
## Configuration: Release
## #
## rversion: 4.4.1
## R_HOME: 'D:\RINSTALL'
## R_ARCH: /x64
## #
## pgSRCversion: REL_14_STABLE
## PG_SOURCE: 'D:\PGSOURCE'
## buildpgFromSRC: true
## buildpgFromSRCmethod: make
## PG_HOME: 'D:\PGINSTALL'
## #
## # EnterpriseDB PostgreSQL for Windows
## # pgWINversion: 14.x-y
## #
## # A HUMAN must manually see the VERSION here. (seen Jul 13 2024 EST)
## # Jul 2024 - Pre-installed Github Actions PostgreSQL for Windows version is x64-14
## # ServiceName postgresql-x64-14
## # Version 14.12
## # REAFFIRMED SEP 29 2024
## # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
## # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software
## #
## MSYS2testonpgWIN: true
defaults:
run:
shell: ${{ matrix.shellEnv || 'bash' }}
steps:
- name: Windows Machine Stats systeminfo
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
systeminfo
- name: Prepare to Download Files from Github
shell: powershell
run: |
git config --global core.autocrlf input
git config --global advice.detachedHead false
- name: Matrix Variables
if: matrix.os == 'windows-latest'
shell: powershell
run: |
# systeminfo
echo "${{ matrix.compilerEnv }} on ${{ matrix.os }}"
# JUL 2023 - only THIS exists in Github Actions
if( Test-Path "C:\Program Files\PostgreSQL\14" ) {
"PostgreSQL for Windows x64-14 exists."
} else {
"PostgreSQL for Windows x64-14 does not exist."
}
function Set-EnvVar {param($X) Add-Content -Path ${env:GITHUB_ENV} -Value "$X"}
#
${env:HEAD8_GITHUB_SHA} = "${env:GITHUB_SHA}".SubString(0,8)
Set-EnvVar "HEAD8_GITHUB_SHA=${env:HEAD8_GITHUB_SHA}"
echo "HEAD8_GITHUB_SHA: ${env:HEAD8_GITHUB_SHA}"
${env:os} = "${{ matrix.os }}"
if("${env:os}" -eq ""){${env:os} = "notset"}
Set-EnvVar "os=${env:os}"
echo "os: ${env:os}"
${env:Platform} = "${{ matrix.Platform }}"
if("${env:Platform}" -eq ""){${env:Platform} = "notset"}
Set-EnvVar "Platform=${env:Platform}"
echo "Platform: ${env:Platform}"
${env:Configuration} = "${{ matrix.Configuration }}"
if("${env:Configuration}" -eq ""){${env:Configuration} = "notset"}
Set-EnvVar "Configuration=${env:Configuration}"
echo "Configuration: ${env:Configuration}"
${env:rversion} = "${{ matrix.rversion }}"
if("${env:rversion}" -eq ""){${env:rversion} = "notset"}
Set-EnvVar "rversion=${env:rversion}"
echo "rversion: ${env:rversion}"
${env:rmajor} = "notset"
${env:rminor} = "notset"
${env:rpatch} = "notset"
${env:rversionnumeric} = "notset"
$matches = @()
if("${env:rversion}" -ne "notset") {
# R-major.minor.patch
# R-major.minor.patchpatched
if(${env:rversion} -match '(\d+)') { ${env:rmajor} = $matches[1]; $matches = @() }
if(${env:rversion} -match '\d+[.](\d+)') { ${env:rminor} = $matches[1]; $matches = @() }
if(${env:rversion} -match '\d+[.]\d+[.](\d+)') { ${env:rpatch} = $matches[1]; $matches = @() }
if(${env:rversion} -match '\d+[.]\d+[.](\d+)') {
${env:rversionnumeric} = ([int]"${env:rmajor}" * 10000) + ([int]"${env:rminor}" * 100) + ([int]"${env:rpatch}")
}
$matches = @()
}
if("${env:rversion}" -match 'devel') {
${env:rmajor} = "devel"
${env:rminor} = "devel"
${env:rpatch} = "devel"
${env:rversionnumeric} = "999999"
}
$matches = @()
Set-EnvVar "rmajor=${env:rmajor}"
Set-EnvVar "rminor=${env:rminor}"
Set-EnvVar "rpatch=${env:rpatch}"
Set-EnvVar "rversionnumeric=${env:rversionnumeric}"
echo " rmajor: ${env:rmajor}"
echo " rminor: ${env:rminor}"
echo " rpatch: ${env:rpatch}"
echo "rversionnumeric: ${env:rversionnumeric}"
${env:rversionlong} = "notset"
# derived (this will be changed FAR FAR below)
${env:rversionlong} = ${env:rversion}
Set-EnvVar "rversionlong=${env:rversionlong}"
${env:bit} = "notset"
# derived
if("${env:Platform}" -eq "x64") { ${env:bit} = "64" }
if("${env:Platform}" -eq "x86") { ${env:bit} = "32" }
if("${env:Platform}" -eq "notset") { ${env:bit} = "notset" }
Set-EnvVar "bit=${env:bit}"
echo "bit: ${env:bit}"
${env:R_HOME} = "${{ matrix.R_HOME }}"
if("${env:R_HOME}" -eq ""){${env:R_HOME} = "notset"}
Set-EnvVar "R_HOME=${env:R_HOME}"
echo "R_HOME: ${env:R_HOME}"
${env:R_ARCH} = "${{ matrix.R_ARCH }}"
if("${env:R_ARCH}" -eq ""){${env:R_ARCH} = "notset"}
Set-EnvVar "R_ARCH=${env:R_ARCH}"
echo "R_ARCH: ${env:R_ARCH}"
${env:compilerEnv} = "${{ matrix.compilerEnv }}"
if("${env:compilerEnv}" -eq ""){${env:compilerEnv} = "notset"}
Set-EnvVar "compilerEnv=${env:compilerEnv}"
echo "compilerEnv: ${env:compilerEnv}"
${env:compilerClass} = "notset"
if("${env:compilerEnv}" -in "MING64", "MINGW32", "UCRT64", "CLANG32", "CLANG64", "CLANGARM64") {
${env:compilerClass} = "MSYS2"
}
if("${env:compilerEnv}" -eq "cygwin") {
${env:compilerClass} = "cygwin"
}
if("${env:compilerEnv}" -eq "msvc") {
${env:compilerClass} = "msvc"
}
Set-EnvVar "compilerClass=${env:compilerClass}"
echo "compilerClass: ${env:compilerClass}"
${env:compilerExe} = "${{ matrix.compilerExe }}"
if("${env:compilerExe}" -eq ""){${env:compilerExe} = "notset"}
Set-EnvVar "compilerExe=${env:compilerExe}"
echo "compilerExe: ${env:compilerExe}"
${env:mingw_env} = "notset"
if ( "${{ matrix.compilerEnv }}" -eq "MINGW64" ) { ${env:mingw_env} = "x86_64" }
if ( "${{ matrix.compilerEnv }}" -eq "MINGW32" ) { ${env:mingw_env} = "i686" }
if ( "${{ matrix.compilerEnv }}" -eq "UCRT64" ) { ${env:mingw_env} = "ucrt-x86_64" }
if ( "${{ matrix.compilerEnv }}" -eq "CLANG32" ) { ${env:mingw_env} = "clang-i686" }
if ( "${{ matrix.compilerEnv }}" -eq "CLANG64" ) { ${env:mingw_env} = "clang-x86_64" }
if ( "${{ matrix.compilerEnv }}" -eq "CLANGARM64" ) { ${env:mingw_env} = "clang-aarch64" }
if ( "${{ matrix.compilerEnv }}" -eq "notset" ) { ${env:mingw_env} = "notset" }
Set-EnvVar "mingw_env=${env:mingw_env}"
echo "mingw_env: ${env:mingw_env}"
${env:MINGW_PACKAGE_PREFIX} = "notset"
if ("${{ env.mingw_env }}" -ne "notset") { ${env:MINGW_PACKAGE_PREFIX} = "mingw-w64-${env:mingw_env}" }
if ("${{ env.mingw_env }}" -eq "notset") { ${env:MINGW_PACKAGE_PREFIX} = "notset" }
Set-EnvVar "MINGW_PACKAGE_PREFIX=${env:MINGW_PACKAGE_PREFIX}"
echo "MINGW_PACKAGE_PREFIX: ${env:MINGW_PACKAGE_PREFIX}"
${env:R_ARCHplat} = "notset"
if("${env:R_ARCH}" -eq "/x64") { ${env:R_ARCHplat} = "x64" }
if("${env:R_ARCH}" -eq "/i386") { ${env:R_ARCHplat} = "i386" }
if("${env:R_ARCH}" -eq "notset") { ${env:R_ARCHplat} = "notset" }
Set-EnvVar "R_ARCHplat=${env:R_ARCHplat}"
echo "R_ARCHplat: ${env:R_ARCHplat}"
${env:pgSRCversion} = "${{ matrix.pgSRCversion }}"
if("${env:pgSRCversion}" -eq ""){${env:pgSRCversion} = "notset"}
Set-EnvVar "pgSRCversion=${env:pgSRCversion}"
echo "pgSRCversion: ${env:pgSRCversion}"
${env:PG_SOURCE} = "${{ matrix.PG_SOURCE }}"
if("${env:PG_SOURCE}" -eq ""){${env:PG_SOURCE} = "notset"}
Set-EnvVar "PG_SOURCE=${env:PG_SOURCE}"
echo "PG_SOURCE: ${env:PG_SOURCE}"
${env:buildpgFromSRC} = "${{ matrix.buildpgFromSRC }}"
if("${env:buildpgFromSRC}" -eq ""){${env:buildpgFromSRC} = "notset"}
Set-EnvVar "buildpgFromSRC=${env:buildpgFromSRC}"
echo "buildpgFromSRC: ${env:buildpgFromSRC}"
${env:buildpgFromSRCmethod} = "${{ matrix.buildpgFromSRCmethod }}"
if("${env:buildpgFromSRCmethod}" -eq ""){${env:buildpgFromSRCmethod} = "notset"}
Set-EnvVar "buildpgFromSRCmethod=${env:buildpgFromSRCmethod}"
echo "buildpgFromSRCmethod: ${env:buildpgFromSRCmethod}"
${env:buildpgANDplrInSRCcontrib} = "${{ matrix.buildpgANDplrInSRCcontrib }}"
if("${env:buildpgANDplrInSRCcontrib}" -eq ""){${env:buildpgANDplrInSRCcontrib} = "notset"}
Set-EnvVar "buildpgANDplrInSRCcontrib=${env:buildpgANDplrInSRCcontrib}"
echo "buildpgANDplrInSRCcontrib: ${env:buildpgANDplrInSRCcontrib}"
${env:PG_HOME} = "${{ matrix.PG_HOME }}"
if("${env:PG_HOME}" -eq ""){${env:PG_HOME} = "notset"}
Set-EnvVar "PG_HOME=${env:PG_HOME}"
echo "PG_HOME: ${env:PG_HOME}"
${env:MSYS2testonpgWIN} = "${{ matrix.MSYS2testonpgWIN }}"
if("${env:MSYS2testonpgWIN}" -eq ""){${env:MSYS2testonpgWIN} = "notset"}
Set-EnvVar "MSYS2testonpgWIN=${env:MSYS2testonpgWIN}"
echo "MSYS2testonpgWIN: ${env:MSYS2testonpgWIN}"
${env:pgWINversion} = "${{ matrix.pgWINversion }}"
if("${env:pgWINversion}" -eq ""){${env:pgWINversion} = "notset"}
Set-EnvVar "pgWINversion=${env:pgWINversion}"
echo "pgWINversion: ${env:pgWINversion}"
${env:pgWINServiceNameHostDefault} = "notset"
${env:pgWINServiceNameHostDefault} = (Get-Service -ErrorAction SilentlyContinue | where-object {$_.name -like "*postgres*"}).Name
echo "pgWINServiceNameHostDefault: ${env:pgWINServiceNameHostDefault}"
Set-EnvVar "pgWINServiceNameHostDefault=${env:pgWINServiceNameHostDefault}"
${env:pgwinmajor} = "notset"
# if any, strip off the: right-most part dot, then numbers, then one hyphen, then numbers.
# e.g. 9.6.24-1 becomes 9.6
# e.g. 13.11-3 becomes 13
if("${env:pgWINversion}" -ne "notset") { ${env:pgwinmajor} = ${env:pgWINversion} -replace "[.]\d+-\d+$" }
if("${env:pgWINversion}" -eq "notset") {
if("${env:pgWINServiceNameHostDefault}" -match "(\d+[.]{0,1}\d+$)") {
# if (1) no entry "pgWINversion: whatever" and yes entry "MSYS2testonpgWIN: true"
# then THIS(14) is the default TESTING(14) "MSYS2testonpgWIN PostgreSQL"
# 9.6
# 13
${env:pgwinmajor} = $matches[1]; $matches = @()
# override
${env:pgWINversion} = "NODOWNLOAD"
}
}
Set-EnvVar "pgwinmajor=${env:pgwinmajor}"
Set-EnvVar "pgWINversion=${env:pgWINversion}"
echo "pgwinmajor: ${env:pgwinmajor}"
echo "pgWINversion: ${env:pgWINversion}"
${env:pgWINversionlong} = "notset"
if("${env:Platform}" -eq "x86" -and "${env:pgWINversion}" -ne "notset") {
${env:pgWINversionlong} = "postgresql-${env:pgWINversion}-windows"
}
if("${env:Platform}" -eq "x64" -and "${env:pgWINversion}" -ne "notset") {
${env:pgWINversionlong} = "postgresql-${env:pgWINversion}-windows-x64"
}
if("${env:Platform}" -eq "notset" -or "${env:pgWINversion}" -eq "notset") {
${env:pgWINversionlong} = "notset"
}
Set-EnvVar "pgWINversionlong=${env:pgWINversionlong}"
echo "pgWINversionlong: ${env:pgWINversionlong}"
if("${env:pgWINversionlong}" -ne "notset") {
${env:ENTDB_PG_DOWNLOAD_URL} = "http://get.enterprisedb.com/postgresql/${env:pgWINversionlong}.exe"
}
if("${env:pgWINversionlong}" -eq "notset") {
${env:ENTDB_PG_DOWNLOAD_URL} = "notset"
}
Set-EnvVar "ENTDB_PG_DOWNLOAD_URL=${env:ENTDB_PG_DOWNLOAD_URL}"
echo "ENTDB_PG_DOWNLOAD_URL: ${env:ENTDB_PG_DOWNLOAD_URL}"
${env:PGVER2} = "notset"
# Prep for Install PostgreSQL for Windows (if applicable)
${env:PGVER2} = ${env:pgwinmajor}
Set-EnvVar "PGVER2=${env:PGVER2}"
echo "PGVER2: ${env:PGVER2}"
${env:PGBIN2} = "notset"
${env:PGREGRESS2} = "notset"
${env:PGDATA2} = "notset"
${env:PGROOT2} = "notset"
if("${env:Platform}" -eq "x64") {
${env:PGBIN2} = "C:\Program Files\PostgreSQL\${env:pgwinmajor}\bin"
if([int]${env:pgwinmajor} -ge 17) {
${env:PGREGRESS2} = "C:\Program Files\PostgreSQL\${env:pgwinmajor}\lib\pgxs\src\test\regress"
} else {
${env:PGREGRESS2} = "C:\Program Files\PostgreSQL\${env:pgwinmajor}\bin"
}
${env:PGDATA2} = "C:\Program Files\PostgreSQL\${env:pgwinmajor}\data"
${env:PGROOT2} = "C:\Program Files\PostgreSQL\${env:pgwinmajor}"
}
if("${env:Platform}" -eq "x86") {
${env:PGBIN2} = "C:\Program Files (x86)\PostgreSQL\${env:pgwinmajor}\bin"
if([int]${env:pgwinmajor} -ge 17) {
${env:PGREGRESS2} = "C:\Program Files (x86)\PostgreSQL\${env:pgwinmajor}\lib\pgxs\src\test\regress"
} else {
${env:PGREGRESS2} = "C:\Program Files (x86)\PostgreSQL\${env:pgwinmajor}\bin"
}
${env:PGDATA2} = "C:\Program Files (x86)\PostgreSQL\${env:pgwinmajor}\data"
${env:PGROOT2} = "C:\Program Files (x86)\PostgreSQL\${env:pgwinmajor}"
}
if("${env:Platform}" -eq "notset") {
${env:PGBIN2} = "notset"
${env:PGREGRESS2} = "notset"
${env:PGDATA2} = "notset"
${env:PGROOT2} = "notset"
}
Set-EnvVar "PGBIN2=${env:PGBIN2}"
Set-EnvVar "PGREGRESS2=${env:PGREGRESS2}"
Set-EnvVar "PGDATA2=${env:PGDATA2}"
Set-EnvVar "PGROOT2=${env:PGROOT2}"
echo "PGBIN2: ${env:PGBIN2}"
echo "PGREGRESS2: ${env:PGREGRESS2}"
echo "PGDATA2: ${env:PGDATA2}"
echo "PGROOT2: ${env:PGROOT2}"
- name: Matrix Windows Platform Specific Variables
if: ${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) }}
shell: powershell
run: |
function Set-EnvVar {param($X) Add-Content -Path ${env:GITHUB_ENV} -Value "$X"}
# enhances and overrides #
${env:rversionlong} = "${{ env.rversionlong }}-win"
$matches = @()
if( "${{ env.rversion }}" -match "2.11.0|2.11.1") {
${env:rversionlong} = "${{ env.rversion }}-win${{ env.bit }}"
}
$matches = @()
${env:rversionlong} = "R-${env:rversionlong}"
Set-EnvVar "rversionlong=${env:rversionlong}"
echo "rversionlong: ${env:rversionlong}"
# CRAN download URL
${env:CRAN_R_DOWNLOAD_URL} ="notset"
$matches = @()
if(-not ("${env:rversionlong}" -match 'patched|devel')) {
if([int]"${{ env.rversionnumeric }}" -ge 30600 ) {
${env:CRAN_R_DOWNLOAD_URL} = "https://cran.r-project.org/bin/windows/base/old/${{ env.rversion }}/${env:rversionlong}.exe"
}
if([int]"${{ env.rversionnumeric }}" -lt 30600 ) {
${env:CRAN_R_DOWNLOAD_URL} = "https://cran-archive.r-project.org/bin/windows/base/old/${{ env.rversion }}/${env:rversionlong}.exe"
}
}
$matches = @()
if("${env:rversionlong}" -match 'patched|devel') {
${env:CRAN_R_DOWNLOAD_URL} = "https://cran.r-project.org/bin/windows/base/${env:rversionlong}.exe"
}
$matches = @()
Set-EnvVar "CRAN_R_DOWNLOAD_URL=${env:CRAN_R_DOWNLOAD_URL}"
echo "CRAN_R_DOWNLOAD_URL: ${env:CRAN_R_DOWNLOAD_URL}"
- name: Checkout Code of This Repository
uses: actions/checkout@v4
# running Meson on GitHub Actions will end up using GCC rather than MSVC
#
# His fix .
# https://dvdhrm.github.io/2021/04/21/meson-msvc-github-actions/
#
# `x64` for 64-bit x86 machines, `x86` for 32-bit x86 machines.
# https://github.com/bus1/cabuild/blob/8c91ebf06b7a5f8405cf93c89a6928e4c76967e0/action/msdevshell/action.yml
- name: Prepare Github Actions, MSVC, and Meson
if: ${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' }}
uses: bus1/cabuild/action/msdevshell@v1
with:
# msvc ARCHITECTURE
architecture: ${{ env.Platform }}
- name: Checkout PostgreSQL Code
if: ${{ env.pgSRCversion != 'notset' }}
uses: actions/checkout@v4
with:
repository: 'postgres/postgres'
# The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, uses the default branch.
# # statics
# REL_16_BETA2
# 19508f4
# 19508f4763b6e55baae788af000ee47e74d24370
# REL_10_23
# 02991e7
# 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4
# # non-statics
# master
# REL_17_STABLE
# REL_16_STABLE
# REL_15_STABLE
#
ref: '${{ env.pgSRCversion }}'
# Relative path under $GITHUB_WORKSPACE to place the repository
path: PGSOURCE
- name: Windows Move PostgreSQL Code
if: ${{ env.os == 'windows-latest' && env.pgSRCversion != 'notset' }}
shell: powershell
run: |
Move-Item -Path PGSOURCE -Destination ${{ env.PG_SOURCE }}
Get-ChildItem ${{ env.PG_SOURCE }}
# I do not want to cache "R for Windows devel version".
#
# Manage my caches
# https://github.com/GITHUBUSER/GITHUBREPOSITORY/actions/caches
#
# TODO - possiblity of a FUTURE workaround
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
#
- name: Cache R-x.y.z Windows Installer Exe
if: ${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) && env.rversion != 'devel' }}
uses: actions/cache@v4
id: cacheRWindowsInstallerExe
with:
path: ${{ env.rversionlong }}.exe
key: ${{ env.rversionlong }}.exe
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache PostgreSQL for Windows
if: >-
${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) && env.pgWINversion != 'notset' &&
(( env.PGVER2 == '14' && env.Platform == 'x86' ) || ( env.PGVER2 != '14' ))
}}
uses: actions/cache@v4
id: cachePGWindowsInstallerExe
with:
path: ${{ env.pgWINversionlong }}.exe
key: ${{ env.pgWINversionlong }}.exe
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 10
- name: Cache GNU diffutils for Test on PostgreSQL for Windows
if: ${{ ( env.os == 'windows-latest' && env.compilerClass == 'MSYS2' && env.MSYS2testonpgWIN == 'true' ) || ( env.os == 'windows-latest' && env.compilerClass == 'msvc' ) }}
uses: actions/cache@v4
id: cacheDiffutilsZip
with:
path: diffutils-2.8.7-1-bin.zip
key: diffutils-2.8.7-1-bin.zip
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache pkgconfiglite for Compile using msvc and meson
if: ${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' }}
uses: actions/cache@v4
id: cachePkgConfigLiteZip
with:
path: pkg-config-lite-0.28-1_bin-win32.zip
key: pkg-config-lite-0.28-1_bin-win32.zip
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache winflexbison for Compile using msvc
if: ${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' }}
uses: actions/cache@v4
id: cacheWinFlexBisonZip
with:
path: win_flex_bison-2.5.24.zip
key: win_flex_bison-2.5.24.zip
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache meson for Compile using msvc and meson
if: ${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' }}
uses: actions/cache@v4
id: cacheMesonMsi
with:
path: meson-1.2.1-64.msi
key: meson-1.2.1-64.msi
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
- name: Cache StrawberryPerl
if: ${{ env.os == 'windows-latest' && env.compilerClass == 'MSYS2' && env.compilerEnv == 'MINGW32' }}
uses: actions/cache@v4
id: cacheStrawberryPerlMsi
with:
path: strawberry-perl-5.38.2.2-64bit.msi
key: strawberry-perl-5.38.2.2-64bit.msi
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
# Notice
# Path R-2.11.1-x64
# Download Name -R-2.11.1-win64.exe
# https://cran-archive.r-project.org/bin/windows/base/old/2.11.1/R-2.11.1-win64.exe
# Path R-2.11.1
# Download Name - R-2.11.1-win32.exe
# https://cran-archive.r-project.org/bin/windows/base/old/2.11.1/R-2.11.1-win32.exe
#
# five seconds
- name: Download R for Windows R-x.y.z R-rmajor.rminor.rpatch
if: >-
${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) &&
steps.cacheRWindowsInstallerExe.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadfileRforWindows
with:
url: ${{ env.CRAN_R_DOWNLOAD_URL }}
- name: Download PostgreSQL for Windows
if: >-
${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) && env.pgWINversion != 'notset' &&
(( env.PGVER2 == '14' && env.Platform == 'x86' ) || ( env.PGVER2 != '14' )) &&
steps.cachePGWindowsInstallerExe.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadfilePGforWindows
with:
url: ${{ env.ENTDB_PG_DOWNLOAD_URL }}
# # The "crazy-max/ghaction-chocolatey@v3" "install SOMEHING_AT_SOURCEFORGE" file download often times-out.
# - name: Choco Install GNU diffutils for Test on PostgreSQL for Windows
# uses: crazy-max/ghaction-chocolatey@v3
# with:
# args: install diffutils
- name: Download GNU diffutils for Test on PostgreSQL for Windows
if: ${{ ( ( env.os == 'windows-latest' && env.compilerClass == 'MSYS2' && env.MSYS2testonpgWIN == 'true' ) || ( env.os == 'windows-latest' && env.compilerClass == 'msvc' ) ) &&
steps.cacheDiffutilsZip.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadDiffutilsZip
with:
retry-times: 1
# verified Jul 13 2024
# last file update 2004-05-24
url: https://zenlayer.dl.sourceforge.net/project/gnuwin32/diffutils/2.8.7-1/diffutils-2.8.7-1-bin.zip
- name: Download pkgconfiglite for Compile using msvc and meson
if: >-
${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' &&
steps.cachePkgConfigLiteZip.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadPkgConfigLiteZip
with:
retry-times: 1
# verified Jul 13 2024
# last file update 2013-01-26
url: http://downloads.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
- name: Download winflexbison for Compile using msvc
if: >-
${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' &&
steps.cacheWinFlexBisonZip.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadWinFlexBisonZip
with:
retry-times: 1
# verified Jul 13 2024
# last file update 2021-01-06
url: https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.24.zip
- name: Download meson for Compile using msvc and meson
if: >-
${{ env.os == 'windows-latest' && env.compilerClass == 'msvc' &&
steps.cacheMesonMsi.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadMesonMsi
with:
retry-times: 1
# verified Jul 13 2024
# We provide an MSI installer on the GitHub release page
# https://mesonbuild.com/Getting-meson.html
# BUT this is the last .msi build and no .msi builds for 1.4.2 and 1.5.0 - STRANGE
# last file update May 30 2024
# https://github.com/mesonbuild/meson/releases/download/1.4.1/meson-1.4.1-64.msi
# https://github.com/mesonbuild/meson/releases/tag/1.4.1
url: https://github.com/mesonbuild/meson/releases/download/1.4.1/meson-1.4.1-64.msi
- name: Download StrawberryPerl
if: >-
${{ env.os == 'windows-latest' && env.compilerClass == 'MSYS2' && env.compilerEnv == 'MINGW32' &&
steps.cacheStrawberryPerlMsi.outputs.cache-hit != 'true'
}}
uses: suisei-cn/[email protected]
id: downloadStrawberryPerlMsi
with:
retry-times: 1
# verified Jul 13 2024
# last file update 2023-12-11
# https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_53822_64bit/strawberry-perl-5.38.2.2-64bit.msi
# https://strawberryperl.com/releases.html
url: https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_53822_64bit/strawberry-perl-5.38.2.2-64bit.msi
- name: Install R for Windows R-x.y.z R-rmajor.rminor.rpatch
if: ${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) }}
env:
R_HOME: ${{ env.R_HOME }}
R_ARCHplat: ${{ env.R_ARCHplat }}
shell: cmd
run: |
echo on
echo R_HOME: %R_HOME%
echo R_ARCHplat: %R_ARCHplat%
rem need "main" for the GUIs and command line utilites to work
rem A comma at the end is O.K
rem Component "notset" is ignored
"${{ env.rversionlong }}.exe" /VERYSILENT /COMPONENTS=main,%R_ARCHplat% /DIR=%R_HOME% /NOICONS /TASKS=
dir "%R_HOME%"
# Github Actions provided PostgreSQL x64-14 (as of Jul 2024)
#
# # Jul 2024
# # The PL/R extension was built using PostreSQL 15
# ServiceName postgresql-x64-14
# Version 14.12
# ServiceStatus Stopped
# ServiceStartType Disabled
# EnvironmentVariables PGBIN=C:\Program Files\PostgreSQL\14\bin
# PGDATA=C:\Program Files\PostgreSQL\14\data
# PGROOT=C:\Program Files\PostgreSQL\14
# Path C:\Program Files\PostgreSQL\14
# UserName postgres
# Password root
# #
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software
#
- name: From Disabled, Enable PostgreSQL x64-14 for Windows and Start and Stop
if: >-
${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' && env.MSYS2testonpgWIN == 'true' || env.compilerClass == 'msvc' ) &&
env.PGVER2 == '14' && env.Platform == 'x64'
}}
shell: cmd
run: |
echo on
sc config "postgresql-x64-14" start= auto
net start postgresql-x64-14
net stop postgresql-x64-14
- name: Install PostgreSQL for Windows and Stop PostgreSQL
if: >-
${{ env.os == 'windows-latest' && ( env.compilerClass == 'MSYS2' || env.compilerClass == 'msvc' ) && env.pgWINversion != 'notset' &&
(( env.PGVER2 == '14' && env.Platform == 'x86' ) || ( env.PGVER2 != '14' ))
}}
env:
PGVER2: ${{ env.PGVER2 }}
PGROOT2: ${{ env.PGROOT2 }}
Platform: ${{ env.Platform }}
shell: cmd
run: |
echo on
"${{ env.pgWINversionlong }}.exe" --unattendedmodeui none --mode unattended --enable-components server,commandlinetools --disable-components pgAdmin,stackbuilder --superpassword "root" > nul
rem postgresql-15.3-4-windows-x64.exe