-
Notifications
You must be signed in to change notification settings - Fork 10
173 lines (149 loc) · 5.45 KB
/
linux-upstream-zlib-ng.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
name: Linux + upstream zlib-ng
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '02 02 * * 6' # Run every Saturday
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
perl:
- latest
zlib-version:
- 'develop'
- '2.2.1'
- '2.2.0'
- '2.1.7'
- '2.1.6'
- '2.1.5'
- '2.1.4'
- '2.1.3'
- '2.1.2'
- '2.0.7'
- '2.0.6'
- '2.0.5'
- '2.0.4'
- '2.0.3'
- '2.0.2'
- '2.0.1'
- '2.0.0'
zlib-native:
- 1
- 0
env:
zlib-source: ${{ github.workspace }}/upstream-zlib-source
zlib-install: ${{ github.workspace }}/upstream-zlib-install
ZLIB_LIB: ${{ github.workspace }}/upstream-zlib-install/lib
ZLIB_INCLUDE: ${{ github.workspace }}/upstream-zlib-install/include
ZLIB_VERSION: ${{ matrix.zlib-version }}
BUILD_ZLIB: 0
ZLIB_NG_PRESENT: 1
USE_ZLIB_NG: ${{ matrix.zlib-native }}
NG_COMPAT_MODE: ${{ matrix.zlib-native == 1 && 'OFF' || 'ON' }}
# Run each step if
# 1. Not a scheduled job
# 2. Is sheduled AND zlib 'develop'
STEP_ENABLED: ${{ ( github.event_name != 'schedule' || ( github.event_name == 'schedule' && matrix.zlib-version == 'develop' ) ) && true || '' }}
defaults:
run:
working-directory: repo
name: Perl ${{ matrix.perl }} with zlib-ng ${{matrix.zlib-version}} USE_ZLIB_NG=${{ matrix.zlib-native }}
steps:
- uses: actions/checkout@v4
with:
path: repo
# - name: Cancel if Scheduled Job and not running the 'develop' branch
# if: github.event_name == 'schedule' && matrix.zlib-version != 'develop'
# run: |
# gh run cancel ${{ github.run_id }}
# gh run watch ${{ github.run_id }}
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make Paths
if: env.STEP_ENABLED
run: |
mkdir -p ${{ env.zlib-source }}
mkdir -p ${{ env.zlib-install }}
mkdir -p ${{ github.workspace }}/repo
- name: Cache zlib ${{matrix.zlib-version}} USE_ZLIB_NG=${{ matrix.zlib-native }}
id: cache-zlib
uses: actions/cache@v4
with:
# NOTE: path doesn't expand variables!
path: upstream-zlib-install
key: ${{ runner.os }}-${{ runner.arch }}-zlib-ng-${{ matrix.zlib-version }}-${{ matrix.zlib-native }}
- name: Wipe develop cached files, if found
if: env.STEP_ENABLED && matrix.zlib-version == 'develop' && steps.cache-zlib.outputs.cache-hit
run: |
rm -fr ${{ env.zlib-install }}
mkdir -p ${{ env.zlib-install }}
- name: Checkout upstream zlib-ng ${{matrix.zlib-version}} USE_ZLIB_NG=${{ matrix.zlib-native }}
if: env.STEP_ENABLED && ( matrix.zlib-version == 'develop' || ! steps.cache-zlib.outputs.cache-hit )
uses: actions/checkout@v4
with:
repository: zlib-ng/zlib-ng
ref: ${{ matrix.zlib-version }}
path: ${{ env.zlib-source }}
- name: Build zlib-ng ${{matrix.zlib-version}} USE_ZLIB_NG=${{ matrix.zlib-native }}
if: env.STEP_ENABLED && ( matrix.zlib-version == 'develop' || ! steps.cache-zlib.outputs.cache-hit )
run: |
mkdir build
cd build
cmake .. \
-DZLIB_COMPAT=${{ env.NG_COMPAT_MODE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.zlib-install }} \
-DZLIBNG_ENABLE_TESTS=OFF \
-DWITH_GZFILEOP=OFF \
-DZLIB_ENABLE_TESTS=OFF \
-DZLIBNG_ENABLE_TESTS=OFF \
-DWITH_OPTIM=OFF
make install
working-directory: ${{ env.zlib-source }}
# - name: Build zlib-ng ${{matrix.zlib-version}} zlib-compat mode ${{ matrix.zlib-native }}
# # if: ( matrix.zlib-version == 'develop' || steps.cache-zlib.outputs.cache-hit == 'false' ) && ! matrix.zlib-native
# if: env.STEP_ENABLED && ( matrix.zlib-version == 'develop' || ! steps.cache-zlib.outputs.cache-hit ) && ! matrix.zlib-native
# run: |
# ./configure --prefix ${{ env.zlib-install }} --zlib-compat
# make
# make test
# make install
# rm -fr ${{ env.zlib-install }}/share
# working-directory: ${{ env.zlib-source }}
# - name: Build zlib-ng ${{matrix.zlib-version}} zlib native mode
# # if: ( matrix.zlib-version == 'develop' || steps.cache-zlib.outputs.cache-hit == 'false' ) && matrix.zlib-native
# if: env.STEP_ENABLED && ( matrix.zlib-version == 'develop' || ! steps.cache-zlib.outputs.cache-hit ) && matrix.zlib-native
# run: |
# ./configure --prefix ${{ env.zlib-install }}
# make
# make test
# make install
# rm -fr ${{ env.zlib-install }}/share
# working-directory: ${{ env.zlib-source }}
- name: Show installed zlib files
if: env.STEP_ENABLED
run: |
find .
shell: bash
working-directory: ${{ env.zlib-install }}
- name: Setup perl
if: env.STEP_ENABLED
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl }}
- name: Perl version
if: env.STEP_ENABLED
run: perl -V
#- name: Install dependencies
# if: env.STEP_ENABLED
# run: |
# cpanm --verbose --installdeps --notest .
- name: Build
if: env.STEP_ENABLED
run: |
perl Makefile.PL && make
- name: Test
if: env.STEP_ENABLED
run: make test