forked from OCamlPro/gnucobol
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (109 loc) · 4.3 KB
/
windows-msys2.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
name: Windows MSYS2 Workflow
on:
pull_request:
branches: [ gcos4gnucobol-3.x ]
push:
# manual run in actions tab - for all branches
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: windows-latest, target: release, sys: mingw64, env: x86_64 }
- { os: windows-latest, target: debug, sys: mingw64, env: x86_64 }
- { os: windows-latest, target: debug, sys: ucrt64, env: ucrt-x86_64 }
- { os: windows-latest, target: debug, sys: clang64, env: clang-x86_64 }
# - { target: debug, sys: mingw32, env: i686 }
runs-on: ${{matrix.os}}
timeout-minutes: 45
steps:
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Checkout code
uses: actions/checkout@v4
- name: Setup environment
run: |
echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV
If ("${{ matrix.target }}" -eq "release") {
echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV
echo CFGOPT= >> $env:GITHUB_ENV
} Else {
echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV
echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
}
- name: Install packages
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{matrix.sys}}
install: autoconf automake libtool make flex bison help2man texinfo
mingw-w64-${{matrix.env}}-cc
mingw-w64-${{matrix.env}}-gmp gmp-devel
mingw-w64-${{matrix.env}}-gettext-runtime gettext-devel
mingw-w64-${{matrix.env}}-ncurses
mingw-w64-${{matrix.env}}-libxml2
mingw-w64-${{matrix.env}}-cjson
mingw-w64-${{matrix.env}}-db libdb-devel
- name: Bootstrap GnuCOBOL
shell: msys2 {0}
run: |
./build_aux/bootstrap install
- name: Configure GnuCOBOL
shell: msys2 {0}
run: |
mkdir _build
cd _build
../configure $CFGOPT --with-db --prefix=/opt/cobol/gnucobol
- name: Upload config-${{matrix.sys}}-${{matrix.target}}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{matrix.sys}}-${{matrix.target}}.log
path: ${{ env.GITHUB_WORKSPACE }}/_build/config.log
- name: Build GnuCOBOL
shell: msys2 {0}
run: |
make -C _build --jobs=$(($(nproc)+1))
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true
- name: Run testuite
shell: msys2 {0}
run: |
sed '/AT_SETUP(\[temporary path invalid\])/a \
AT_SKIP_IF(\[true\])' \
-i tests/testsuite.src/used_binaries.at
make -C _build/tests checkall \
--jobs=$(($(nproc)+1)) \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C _build/tests check \
TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite-${{matrix.sys}}-${{matrix.target}}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite-${{matrix.sys}}-${{matrix.target}}.log
path: ${{ env.GITHUB_WORKSPACE }}/_build/tests/testsuite.log
- name: Package GnuCOBOL
shell: msys2 {0}
run: |
make -C _build distmingw
- name: Tar GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}
shell: msys2 {0}
run: |
cd _build
tar -cvf ../GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar \
"${{ env.DISTDIR }}"
- name: Upload GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar
uses: actions/upload-artifact@v4
with:
name: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar
path: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar