summaryrefslogtreecommitdiff
path: root/neozip/.github/workflows/configure.yml
blob: 952ab847abc57a556a6f51b31d37a405506a116a (plain)
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
name: Configure
on: [workflow_call, workflow_dispatch]
jobs:
  configure:
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Ubuntu GCC
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn

          - name: Ubuntu GCC OSB Symbol Prefix No VPCLMUL
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn --sprefix=zTest_ --without-vpclmulqdq
            build-dir: ../build
            build-src-dir: ../zlib-ng

          - name: Ubuntu GCC Compat No Opt Reduced Mem
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies --with-reduced-mem

          - name: Ubuntu GCC Compat Symbol Prefix
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn --zlib-compat --sprefix=zTest_

          - name: Ubuntu GCC ARM SF
            os: ubuntu-24.04-arm
            compiler: arm-linux-gnueabi-gcc
            configure-args: --warn
            chost: arm-linux-gnueabi
            packages: qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross

          - name: Ubuntu GCC ARM SF Compat No Opt No Gzfileops
            os: ubuntu-24.04-arm
            compiler: arm-linux-gnueabi-gcc
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies --without-gzfileops
            chost: arm-linux-gnueabi
            packages: qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross

          - name: Ubuntu GCC ARM HF
            os: ubuntu-24.04-arm
            compiler: arm-linux-gnueabihf-gcc
            configure-args: --warn
            chost: arm-linux-gnueabihf
            packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross

          - name: Ubuntu GCC ARM HF No Neon No ARMv8
            os: ubuntu-24.04-arm
            compiler: arm-linux-gnueabihf-gcc
            configure-args: --warn --without-neon --without-armv8
            chost: arm-linux-gnueabihf
            packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross

          - name: Ubuntu GCC ARM HF Compat No Opt
            os: ubuntu-24.04-arm
            compiler: arm-linux-gnueabihf-gcc
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies
            chost: arm-linux-gnueabihf
            packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross

          - name: Ubuntu GCC AARCH64
            os: ubuntu-24.04-arm
            compiler: gcc
            configure-args: --warn

          - name: Ubuntu GCC AARCH64 Compat No Opt
            os: ubuntu-24.04-arm
            compiler: gcc
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies

          - name: Ubuntu GCC MIPS
            os: ubuntu-latest
            compiler: mips-linux-gnu-gcc
            configure-args: --warn
            chost: mips-linux-gnu
            packages: qemu-user gcc-mips-linux-gnu libc-dev-mips-cross

          - name: Ubuntu GCC MIPS64
            os: ubuntu-latest
            compiler: mips64-linux-gnuabi64-gcc
            configure-args: --warn
            chost: mips64-linux-gnuabi64
            packages: qemu-user gcc-mips64-linux-gnuabi64 libc-dev-mips64-cross

          - name: Ubuntu GCC PPC
            os: ubuntu-latest
            compiler: powerpc-linux-gnu-gcc
            configure-args: --warn --static
            chost: powerpc-linux-gnu
            packages: qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross
            cflags: -static
            ldflags: -static

          - name: Ubuntu GCC PPC No Opt
            os: ubuntu-latest
            compiler: powerpc-linux-gnu-gcc
            configure-args: --warn --without-optimizations
            chost: powerpc-linux-gnu
            packages: qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross

          - name: Ubuntu GCC PPC64
            os: ubuntu-latest
            compiler: powerpc64-linux-gnu-gcc
            configure-args: --warn --static
            chost: powerpc-linux-gnu
            packages: qemu-user gcc-powerpc64-linux-gnu libc-dev-ppc64-cross
            cflags: -static
            ldflags: -static

          - name: Ubuntu GCC PPC64LE
            os: ubuntu-latest
            compiler: powerpc64le-linux-gnu-gcc
            configure-args: --warn
            chost: powerpc64le-linux-gnu
            packages: qemu-user gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross

          - name: Ubuntu GCC S390X
            os: ubuntu-latest
            compiler: s390x-linux-gnu-gcc
            configure-args: --warn --static
            chost: s390x-linux-gnu
            packages: qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross
            cflags: -static
            ldflags: -static

          - name: Ubuntu GCC S390X No vectorized CRC32
            os: ubuntu-latest
            compiler: s390x-linux-gnu-gcc
            configure-args: --warn --static --without-crc32-vx
            chost: s390x-linux-gnu
            packages: qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross
            cflags: -static
            ldflags: -static

          - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10' || 'Ubuntu' }} GCC S390X DFLTCC
            os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }}
            compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }}
            configure-args: --warn --static --with-dfltcc-deflate --with-dfltcc-inflate
            chost: ${{ github.repository != 'zlib-ng/zlib-ng' &&  's390x-linux-gnu' || '' }}
            packages: ${{ github.repository != 'zlib-ng/zlib-ng' && 'qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross' || '' }}
            cflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}
            ldflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}

          - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10' || 'Ubuntu' }} GCC S390X DFLTCC Compat
            os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }}
            compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }}
            configure-args: --warn --zlib-compat --static --with-dfltcc-deflate --with-dfltcc-inflate
            chost: ${{ github.repository != 'zlib-ng/zlib-ng' &&  's390x-linux-gnu' || '' }}
            packages: ${{ github.repository != 'zlib-ng/zlib-ng' && 'qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross' || '' }}
            cflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}
            ldflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }}

          - name: Ubuntu Emscripten WASM32
            os: ubuntu-latest
            chost: wasm32
            configure-args: --warn --zlib-compat --static
            configure-prefix: emconfigure
            cflags: -static
            ldflags: -static
            emu-run: node

          - name: macOS Clang (Intel)
            os: macos-15-intel
            compiler: clang
            configure-args: --warn

          - name: macOS Clang (Intel) Compat No Opt
            os: macos-15-intel
            compiler: clang
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies

          - name: macOS Clang (ARM64)
            os: macos-latest
            compiler: clang
            cflags: -std=gnu11
            configure-args: --warn

          - name: macOS Clang (ARM64) Compat No Opt
            os: macos-latest
            compiler: clang
            cflags: -std=gnu11
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies

          - name: Ubuntu GCC RISCV64
            os: ubuntu-latest
            compiler: riscv64-linux-gnu-gcc
            configure-args: --warn
            chost: riscv64-linux-gnu
            packages: qemu-user crossbuild-essential-riscv64

          - name: Ubuntu GCC RISCV64 No RVV No ZBC
            os: ubuntu-latest
            compiler: riscv64-linux-gnu-gcc
            configure-args: --warn --without-rvv --without-zbc
            chost: riscv64-linux-gnu
            packages: qemu-user crossbuild-essential-riscv64

          - name: Ubuntu GCC RISCV64 Compat No Opt
            os: ubuntu-latest
            compiler: riscv64-linux-gnu-gcc
            configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies
            chost: riscv64-linux-gnu
            packages: qemu-user crossbuild-essential-riscv64

          - name: Ubuntu GCC 14 LoongArch64
            os: ubuntu-latest
            compiler: loongarch64-linux-gnu-gcc-14
            configure-args: --warn --static
            chost: loongarch64-linux-gnu
            packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross
            cflags: -static
            ldflags: -static

          - name: Ubuntu GCC 14 LoongArch64 Compat No Opt
            os: ubuntu-latest
            compiler: loongarch64-linux-gnu-gcc-14
            configure-args: --warn --static --zlib-compat --without-optimizations --without-new-strategies
            chost: loongarch64-linux-gnu
            packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross
            cflags: -static
            ldflags: -static

    steps:
    - name: Checkout repository
      uses: actions/checkout@v6
      with:
        show-progress: 'false'

    - name: Add ubuntu mirrors
      if: runner.os == 'Linux' && matrix.packages
      # Github Actions caching proxy is at times unreliable
      run: |
        echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt
        curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
        sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list

    - name: Install packages (Ubuntu)
      if: runner.os == 'Linux' && matrix.packages
      run: |
        sudo apt-get update
        sudo apt-get install -y ${{ matrix.packages }}

    - name: Install packages (macOS)
      if: runner.os == 'macOS'
      run: brew install ninja ${{ matrix.packages }}
      env:
        HOMEBREW_NO_INSTALL_CLEANUP: 1

    - name: Install Emscripten
      if: contains(matrix.name, 'WASM32')
      uses: mymindstorm/setup-emsdk@v14

    - name: Generate project files
      run: |
        mkdir ${{ matrix.build-dir || '.not-used' }}
        cd ${{ matrix.build-dir || '.' }}
        ${{ matrix.configure-prefix }} ${{ matrix.build-src-dir || '.' }}/configure ${{ matrix.configure-args }}
      env:
        CC: ${{ matrix.compiler }}
        CFLAGS: ${{ matrix.cflags }}
        LDFLAGS: ${{ matrix.ldflags }}
        CHOST: ${{ matrix.chost }}
        EMU_RUN: ${{ matrix.emu-run }}
        CI: true

    - name: Compile source code
      run: make -j5
      working-directory: ${{ matrix.build-dir }}

    - name: Run test cases
      run: make test
      working-directory: ${{ matrix.build-dir }}

    - name: Upload build errors
      uses: actions/upload-artifact@v7
      if: failure()
      with:
        name: ${{ matrix.name }} (configure)
        path: |
          **/Makefile
          **/configure.log
        retention-days: 30