|
1 | | -name: MacOS |
| 1 | +name: MacOS Workflow |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
|
7 | 7 | # manual run in actions tab - for all branches |
8 | 8 | workflow_dispatch: |
9 | 9 |
|
| 10 | +env: |
| 11 | + HOMEBREW_ROOT: /opt/homebrew/opt |
| 12 | + |
10 | 13 | jobs: |
11 | 14 | build: |
| 15 | + #runs-on: macos-latest-large # macos 14, amd64 |
| 16 | + runs-on: macos-latest # macos 14, arm64 |
| 17 | + timeout-minutes: 10 |
12 | 18 | strategy: |
13 | 19 | fail-fast: false |
14 | 20 | matrix: |
15 | | - os: |
16 | | - # - macos-latest-large # macos 14, amd64 |
17 | | - - macos-latest # macos 14, arm64 |
18 | 21 | isam: |
19 | 22 | - db |
20 | 23 | - visam |
21 | 24 |
|
22 | | - runs-on: ${{ matrix.os }} |
23 | | - |
24 | 25 | steps: |
25 | 26 |
|
26 | | - - name: Configure git |
27 | | - run: git config --global core.symlinks false |
28 | | - |
29 | 27 | - name: Set git user |
30 | 28 | run: | |
31 | 29 | git config --global user.name github-actions |
32 | 30 | git config --global user.email github-actions-bot@users.noreply.github.com |
33 | 31 |
|
| 32 | + # Why was this necessary ? Works fine without it... |
| 33 | + # - name: Configure git |
| 34 | + # run: git config --global core.symlinks false |
| 35 | + |
34 | 36 | - name: Checkout code |
35 | 37 | uses: actions/checkout@v4 |
36 | 38 |
|
| 39 | + - name: Setup build environment |
| 40 | + run: | |
| 41 | + echo "TERM=vt100" >> $GITHUB_ENV |
| 42 | + echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV |
| 43 | +
|
37 | 44 | - name: Install packages |
38 | 45 | run: | |
39 | | - brew install pkg-config automake libtool help2man texinfo bison berkeley-db@4 json-c |
40 | | - opt="/opt/homebrew/opt" |
41 | | - echo "$opt/pkg-config/bin" >> $GITHUB_PATH |
42 | | - echo "$opt/bison/bin" >> $GITHUB_PATH |
43 | | - echo "LDFLAGS=-L$opt/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV |
44 | | - echo "CPPFLAGS=-I$opt/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV |
45 | | -
|
46 | | - - name: Installing VISAM prerequisite |
| 46 | + brew update |
| 47 | + brew install autoconf automake libtool bison \ |
| 48 | + help2man texinfo \ |
| 49 | + berkeley-db@4 json-c |
| 50 | + echo "$HOMEBREW_ROOT/bison/bin" >> $GITHUB_PATH |
| 51 | + echo "LDFLAGS=-L$HOMEBREW_ROOT/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV |
| 52 | + echo "CPPFLAGS=-I$HOMEBREW_ROOT/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV |
| 53 | +
|
| 54 | + - name: Install VISAM |
47 | 55 | if: ${{ matrix.isam == 'visam' }} |
48 | 56 | run: | |
49 | | - wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z |
| 57 | + curl -LO http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z |
50 | 58 | tar -xvzf visam-2.2.tar.Z |
51 | 59 | cd visam-2.2 |
52 | | - ./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault |
| 60 | + ./configure --prefix=/opt/visam --enable-vbisamdefault |
53 | 61 | chmod u+x build_aux/install-sh |
54 | | - make |
55 | | - sudo make install |
56 | | - echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV |
57 | | - echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV |
58 | | - echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV |
| 62 | + make && sudo make install |
| 63 | + echo "CPATH=/opt/visam/include" >> $GITHUB_ENV |
| 64 | + echo "LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV |
| 65 | + echo "LD_LIBRARY_PATH=/opt/visam/lib" >> $GITHUB_ENV |
59 | 66 |
|
60 | | - - name: bootstrap |
61 | | - run: | |
62 | | - ./build_aux/bootstrap install |
63 | | -
|
64 | | - - name: Build environment setup |
65 | | - run: | |
66 | | - mkdir _build |
67 | | - echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV |
68 | | - export TERM="vt100" |
69 | | - echo "TERM=$TERM" >> $GITHUB_ENV |
| 67 | + - name: Bootstrap GnuCOBOL |
| 68 | + run: ./build_aux/bootstrap install |
70 | 69 |
|
71 | | - - name: configure |
| 70 | + - name: Configure GnuCOBOL |
72 | 71 | run: | |
73 | | - cd _build |
74 | | - export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS" |
75 | | - export CFLAGS="-Wno-unused-command-line-argument -Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS" |
| 72 | + mkdir _build && cd _build |
76 | 73 | ../configure --with-${{ matrix.isam }} \ |
77 | 74 | --with-indexed=${{ matrix.isam }} \ |
78 | 75 | --enable-cobc-internal-checks \ |
79 | 76 | --enable-hardening \ |
80 | | - --prefix /opt/cobol/gnucobol |
| 77 | + --prefix=/opt/cobol/gnucobol \ |
| 78 | + CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS" \ |
| 79 | + CFLAGS="-Wno-unused-command-line-argument -Wno-parentheses-equality $CFLAGS" |
| 80 | +
|
| 81 | + - name: Build GnuCOBOL |
| 82 | + run: make -C _build --jobs=$((${NPROC}+1)) |
81 | 83 |
|
82 | | - - name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log |
| 84 | + - name: Upload config-${{ matrix.isam }}.log |
| 85 | + if: ${{ !cancelled() }} |
83 | 86 | uses: actions/upload-artifact@v4 |
84 | | - if: failure() |
85 | 87 | with: |
86 | | - name: config-${{ matrix.os }}-${{ matrix.isam }}.log |
| 88 | + name: config-${{ matrix.isam }}.log |
87 | 89 | path: _build/config.log |
88 | 90 |
|
89 | | - - name: make |
90 | | - run: | |
91 | | - make -C _build --jobs=$((${NPROC}+1)) |
92 | | -
|
93 | | - # make install must be done before make check, otherwis |
94 | | - # execution of generated COBOL files fail for a missing |
95 | | - # /usr/local/lib/libcob.dylib |
96 | | - - name: make install |
| 91 | + # make install must be done before make check, otherwise execution of |
| 92 | + # generated COBOL files fail for a missing /usr/local/lib/libcob.dylib |
| 93 | + - name: Install GnuCOBOL |
97 | 94 | run: | |
98 | 95 | sudo make -C _build install |
99 | 96 | find /opt/cobol > _build/install.log |
100 | 97 |
|
101 | | - - name: Upload install-${{ matrix.os }}-${{ matrix.isam }}.log |
| 98 | + - name: Upload install-${{ matrix.isam }}.log |
102 | 99 | uses: actions/upload-artifact@v4 |
103 | 100 | with: |
104 | | - name: install-${{ matrix.os }}-${{ matrix.isam }}.log |
| 101 | + name: install-${{ matrix.isam }}.log |
105 | 102 | path: _build/install.log |
106 | 103 |
|
107 | | - - name: check |
| 104 | + - name: Adjust testsuite |
| 105 | + run: | |
| 106 | + cd tests/testsuite.src |
| 107 | + sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a \ |
| 108 | + AT_SKIP_IF(\[true\])' run_file.at |
| 109 | + sed -i '' '/AT_SETUP(\[EXTFH: using ISAM callback\])/a \ |
| 110 | + AT_SKIP_IF(\[true\])' run_file.at |
| 111 | + sed -i '' '/AT_SETUP(\[trace feature\])/a \ |
| 112 | + AT_SKIP_IF(\[true\])' run_file.at |
| 113 | + sed -i '' '/AT_SETUP(\[trace feature with subroutine\])/a \ |
| 114 | + AT_SKIP_IF(\[true\])' run_file.at |
| 115 | + sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a \ |
| 116 | + AT_SKIP_IF(\[true\])' run_file.at |
| 117 | +
|
| 118 | + - name: Run testsuite |
108 | 119 | run: | |
109 | | - sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a\ |
110 | | - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at |
111 | | - sed -i '' '/AT_SETUP(\[EXTFH: using ISAM callback\])/a\ |
112 | | - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at |
113 | | - sed -i '' '/AT_SETUP(\[trace feature\])/a\ |
114 | | - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at |
115 | | - sed -i '' '/AT_SETUP(\[trace feature with subroutine\])/a\ |
116 | | - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at |
117 | | - sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a\ |
118 | | - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at |
119 | | - make -C _build check \ |
120 | | - TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" |
121 | | -
|
122 | | - - name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log |
| 120 | + make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \ |
| 121 | + make -C _build check TESTSUITEFLAGS="--recheck --verbose" |
| 122 | +
|
| 123 | + - name: Upload testsuite-${{ matrix.isam }}.log |
| 124 | + if: ${{ !cancelled() }} |
123 | 125 | uses: actions/upload-artifact@v4 |
124 | | - if: failure() |
125 | 126 | with: |
126 | | - name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log |
| 127 | + name: testsuite-${{ matrix.isam }}.log |
127 | 128 | path: _build/tests/testsuite.log |
128 | 129 |
|
129 | 130 | - name: Cache newcob.val |
130 | 131 | uses: actions/cache@v4 |
131 | 132 | with: |
132 | 133 | path: _build/tests/cobol85/newcob.val |
133 | 134 | key: newcob-val |
134 | | - save-always: true |
135 | 135 | enableCrossOsArchive: true |
136 | 136 |
|
137 | | - - name: NIST85 Test Suite |
138 | | - run: | |
139 | | - make -C _build/tests/cobol85 EXEC85 test \ |
140 | | - --jobs=$((${NPROC}+1)) |
| 137 | + - name: Run NIST85 testsuite |
| 138 | + run: make -C _build test --jobs=$((${NPROC}+1)) |
| 139 | + |
| 140 | + - name: Upload NIST85 Test Suite results |
| 141 | + if: ${{ !cancelled() }} |
| 142 | + uses: actions/upload-artifact@v4 |
| 143 | + with: |
| 144 | + name: NIST85 results on ${{ matrix.isam }} |
| 145 | + path: | |
| 146 | + _build/tests/cobol85/summary.* |
| 147 | + _build/tests/cobol85/**/*.log |
| 148 | + _build/tests/cobol85/**/*.out |
| 149 | + _build/tests/cobol85/**/duration.txt |
0 commit comments