forked from gap-system/gap
-
Notifications
You must be signed in to change notification settings - Fork 0
214 lines (185 loc) · 7.19 KB
/
cross.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
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
# test GAP cross compilation
name: cross
# Trigger the workflow on push or pull request
on:
pull_request:
push:
concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
env:
# default config flags: enable debug asserts
CONFIGFLAGS: "--enable-debug"
jobs:
test_on_arch:
# The host should always be linux
runs-on: ubuntu-22.04
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
# Run steps on a matrix of arch/distro combinations
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64
distro: ubuntu18.04
- arch: ppc64le
distro: alpine_latest
- arch: s390x
distro: fedora_latest
steps:
- uses: actions/checkout@v4
- name: Download required GAP packages
run: |
wget https://github.com/gap-system/PackageDistro/releases/download/latest/packages-required.tar.gz
mkdir pkg
cd pkg
tar xvf ../packages-required.tar.gz
- uses: uraimo/run-on-arch-action@v2
name: Build GAP and run tests
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
apt-get update -q -y
apt-get install -q -y git build-essential expect autoconf libtool libgmp-dev libreadline-dev zlib1g-dev
;;
fedora*)
dnf -y update
dnf -y install diffutils git gcc gcc-c++ make expect autoconf libtool gmp gmp-devel readline readline-devel zlib zlib-devel
;;
alpine*)
apk update
apk add bash git build-base expect autoconf libtool gmp-dev readline-dev zlib-dev
;;
esac
# Do the thing
run: |
set -x
uname -a
pwd
ls -al
git config --global --add safe.directory $PWD # see https://github.com/gap-system/gap/issues/4861
git status
git show --pretty=fuller -s
./autogen.sh
./configure
make -j2 V=1
make citests
cross_compile:
# The host should always be linux
runs-on: ubuntu-22.04
name: Cross compiler for s390x
#env:
# CC: gcc-11-s390x-linux-gnu
# CXX: g++-11-s390x-linux-gnu
steps:
- name: Install Cross-Compile Support
uses: fingolfin/gha-ubuntu-cross@patch-1 # FIXME: see https://github.com/cyberjunk/gha-ubuntu-cross/pull/8
with:
arch: s390x
- name: Install general build dependencies
run: sudo apt-get install -q -y git autoconf libtool
- name: Install cross compile dependencies
run: sudo apt-get install -q -y git libgmp-dev:s390x libreadline-dev:s390x zlib1g-dev:s390x
- uses: actions/checkout@v4
- run: ./autogen.sh
- name: Native compile
run: |
# When building a git snapshot, configure & compile a native version of GAP to
# generate ffdata.{c,h}, c_oper1.c and c_type1.c -- in a GAP release tarball
# this is not necessary.
mkdir native-build
cd native-build
../configure --without-readline
make -j2
cp build/c_*.c build/ffdata.* ../src/
cd ..
- name: Configure
run: ./configure --host="s390x-linux-gnu"
- name: Cross compile
run: make -j2 V=1 all build-testlibgap build-testkernel
- name: Fixup sysinfo.gap
run: rm sysinfo.gap && make SYSINFO_CC=gcc SYSINFO_CXX=g++ sysinfo.gap
- name: Download required GAP packages
run: make bootstrap-pkg-minimal
- name: Run tests in VM
uses: uraimo/run-on-arch-action@v2
with:
arch: s390x
distro: ubuntu22.04
# Not required, but speeds up builds
githubToken: ${{ github.token }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
apt-get update -q -y
# we need build-essential for make and gcc (the latter is used by gac and
# hence by the tests involving mockpkg)
apt-get install -q -y build-essential git expect libgmp10 libreadline8 zlib1g
# Do the thing
run: |
set -x
uname -a
pwd
ls -al
git config --global --add safe.directory $PWD # see https://github.com/gap-system/gap/issues/4861
git status
git show --pretty=fuller -s
make citests
openbsd:
runs-on: ubuntu-latest
name: Test in OpenBSD
env:
AUTOCONF_VERSION: 2.71
steps:
- uses: actions/checkout@v4
- name: Download required GAP packages
run: |
wget https://github.com/gap-system/PackageDistro/releases/download/latest/packages-required.tar.gz
mkdir pkg
cd pkg
tar xvf ../packages-required.tar.gz
- name: Test in OpenBSD
id: test
uses: vmactions/openbsd-vm@v1
with:
envs: 'AUTOCONF_VERSION'
usesh: true
prepare: |
pkg_add bash gmake autoconf-2.71 libtool expect gmp
# Do the thing
run: |
set -x
uname -a
pwd
ls -al
git config --global --add safe.directory $PWD # see https://github.com/gap-system/gap/issues/4861
git status
git show --pretty=fuller -s
rm -rf extern # ensure we don't build and link against bundled libraries
./autogen.sh
./configure --with-gmp=/usr/local --without-readline
gmake -j2 V=1
gmake check
#gmake citests