-
Notifications
You must be signed in to change notification settings - Fork 24
162 lines (141 loc) · 5.67 KB
/
windows-msvc-bdb.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
name: Windows MSVC BDB (build only)
on:
pull_request:
branches: [ gc4 ]
push:
branches: [ gc3_to_gc4, gc4 ]
# manual run in actions tab - for all branches
workflow_dispatch:
env:
FLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip
MSBUILD: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe
VCVARS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
VCPKG_ROOT: C:\vcpkg
VCPKGS: mpir:x64-windows pdcurses:x64-windows berkeleydb:x64-windows libxml2:x64-windows cjson:x64-windows
MSYS2_ROOT: C:\msys64
MSYSPKGS: autoconf
MSYSTEM: UCRT64
MSYSTEM_CHOST: x86_64-w64-mingw32
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email github-actions-bot@users.noreply.github.com
- name: Checkout code
uses: actions/checkout@v3
- name: Setup environment
run: echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV
- name: Restore VCPKG package cache
id: restore-vcpkg
uses: actions/cache/restore@v3
with:
key: cache-vcpkg
path: |
${{ env.VCPKG_ROOT }}/installed
${{ env.VCPKG_ROOT }}/packages
- name: Install VCPKG packages
if: steps.restore-vcpkg.outputs.cache-hit != 'true'
run: |
cd $env:VCPKG_ROOT
git pull
.\bootstrap-vcpkg.bat -disableMetrics
vcpkg integrate install
vcpkg install (-split $env:VCPKGS)
vcpkg update
vcpkg upgrade (-split $env:VCPKGS) --no-dry-run
- name: Save VCPKG package cache
if: steps.restore-vcpkg.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
key: cache-vcpkg
path: |
${{ env.VCPKG_ROOT }}/installed
${{ env.VCPKG_ROOT }}/packages
- name: Restore WinFlexBison cache
uses: actions/cache/restore@v3
id: restore-flexbison
with:
key: cache-flexbison
path: ${{ env.GITHUB_WORKSPACE }}\flexbison
- name: Install WinFlexBison
if: steps.restore-flexbison.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri $env:FLEXBISON -OutFile flexbison.zip
Expand-Archive flexbison.zip -DestinationPath flexbison
- name: Save WinFlexBison cache
if: steps.restore-flexbison.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
key: cache-flexbison
path: ${{ env.GITHUB_WORKSPACE }}/flexbison
- name: Configure GnuCOBOL
run: |
cd build_windows
Get-Content -Path 'config.h.in' | ForEach-Object { $_ `
-replace '(#define\s+CONFIGURED_ISAM)\s.+$', '$1 BDB' `
-replace '(#define\s+CONFIGURED_CURSES)\s.+$', '$1 PDCURSES' `
-replace '(#define\s+CONFIGURED_XML)\s.+$', '$1 XML2' `
-replace '(#define\s+CONFIGURED_JSON)\s.+$', '$1 CJSON_CJSON' `
} | Set-Content -Path 'config.h'
& .\maketarstamp.ps1 > tarstamp.h
- name: Generate parser
run: |
$env:PATH = "$pwd\flexbison;$env:PATH"
cd build_windows
cmd /C makebisonflex.cmd
- name: Build GnuCOBOL
run: |
cd build_windows
vcpkg integrate install
& $env:MSBUILD "vs2019\GnuCOBOL.sln" /m /p:Platform=x64 /p:Configuration=Release
- name: Install MSYS2 packages
shell: C:\shells\msys2bash.cmd {0}
run: |
pacman --needed --noconfirm -S $MSYSPKGS
- name: Building testsuite
shell: C:\shells\msys2bash.cmd {0}
run: |
cd tests
echo at_testdir=\'tests\' > atconfig
echo abs_builddir=\'$(pwd)\' >> atconfig
echo at_srcdir=\'./\' >> atconfig
echo abs_srcdir=\'$(pwd)/\' >> atconfig
echo at_top_srcdir=\'../\' >> atconfig
echo abs_top_srcdir=\'$(pwd)/../\' >> atconfig
echo at_top_build_prefix=\'../\' >> atconfig
echo abs_top_builddir=\'$(pwd)/../\' >> atconfig
echo at_top_builddir=\$at_top_build_prefix >> atconfig
echo EXEEXT=\'.exe\' >> atconfig
echo AUTOTEST_PATH=\'tests\' >> atconfig
echo SHELL=\${CONFIG_SHELL-\'/bin/sh\'} >> atconfig
echo m4_define\([AT_PACKAGE_STRING], [GnuCOBOL 4.0-dev]\) > package.m4
echo m4_define\([AT_PACKAGE_BUGREPORT], [bug-gnucobol@gnu.org]\) >> package.m4
sed 's/x64\/Debug/x64\/Release/g' atlocal_win > atlocal
sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at
autom4te --lang=autotest -I ./testsuite.src ./testsuite.at -o ./testsuite
- name: Running testsuite
continue-on-error: true
shell: cmd
run: |
set COB_CFLAGS=/I "%cd%" /I "%cd%\build_windows" /I "%VCPKG_ROOT%\installed\x64-windows\include"
set COB_LIBS=libcob-5.lib /LIBPATH:"%cd%\build_windows\x64\Release"
set PATH="%cd%\build_windows\x64\Release";"%cd%\bin";%PATH%
set COB_CONFIG_DIR=%cd%\config
call "%VCVARS%"
cd bin
cobc -x gcdiff.c
cd ..\tests
bash -c "./testsuite || ./testsuite --recheck --verbose"
- name: Upload testsuite.log
uses: actions/upload-artifact@v3
with:
name: testsuite.log
path: ${{ env.GITHUB_WORKSPACE }}/tests/testsuite.log