-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
139 lines (131 loc) · 4.45 KB
/
action.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
name: 'Setup GAP for package testing'
description: 'Download and compile CI scripts, GAP and its packages'
inputs:
GAP_PKGS_TO_CLONE:
description: 'the GAP packages to clone'
required: false
default: ''
GAP_PKGS_TO_BUILD:
description: 'the GAP packages to build'
required: false
default: 'io profiling'
GAPBRANCH:
description: 'the gap branch to clone'
required: false
default: 'master'
HPCGAP:
description: 'build HPC-GAP if set to yes'
required: false
default: 'no'
ABI:
description: 'set to 32 to use 32bit build flags for the package'
required: false
default: ''
CONFIGFLAGS:
description: 'arguments to pass to the GAP configure script (e.g. --enable-debug)'
required: false
default: ''
GAP_BOOTSTRAP:
description: 'make bootstrap-pkg-? (i.e. full/minimal)'
required: false
default: 'full'
env:
CHERE_INVOKING: 1
runs:
using: "composite"
steps:
- name: "Install dependencies"
run: |
echo "Installing dependencies"
if [ "${{runner.os}}" = "Linux" ]; then
if [ "${{inputs.ABI}}" = "32" ]; then
sudo dpkg --add-architecture i386
sudo apt-get update
packages=(
libgmp-dev:i386
libreadline-dev:i386
zlib1g-dev:i386
gcc-multilib
g++-multilib
)
else
packages=(
libgmp-dev
libreadline-dev
zlib1g-dev
)
fi
sudo apt-get install "${packages[@]}"
elif [ "${{runner.os}}" = "macOS" ]; then
if [ "${{inputs.ABI}}" = "32" ]; then
echo "Can't use macOS with 32bit!"
exit 1
fi
brew install gmp zlib autoconf && brew link zlib
fi
shell: bash
- name: "Clone GAP"
shell: bash
run: git clone --depth=2 -b ${{ inputs.GAPBRANCH }} https://github.com/gap-system/gap.git $HOME/gap
- name: "Build GAP"
shell: bash
env:
ABI: ${{ inputs.ABI }}
run: |
cd $HOME/gap
CONFIGFLAGS="${{ inputs.CONFIGFLAGS }}"
# for HPC-GAP, add suitable flags
if [[ ${{ inputs.HPCGAP }} = yes ]]; then
CONFIGFLAGS="$CONFIGFLAGS --enable-hpcgap"
fi
# build GAP in a subdirectory
./autogen.sh
./configure $CONFIGFLAGS
make -j4 V=1
# make it available
ln -s $HOME/gap/gap /usr/local/bin/gap
- name: "Download packages"
shell: bash
run: |
cd $HOME/gap
# download packages; instruct wget to retry several times if the
# connection is refused, to work around intermittent failures.
# for older versions, set WGET, for GAP >= 4.11 set DOWNLOAD
WGET="wget -N --no-check-certificate --tries=5 --waitretry=5 --retry-connrefused"
make bootstrap-pkg-${{ inputs.GAP_BOOTSTRAP }} DOWNLOAD="$WGET" WGET="$WGET"
- name: "Clone additional GAP packages"
shell: bash
run: |
# optionally: clone specific package versions, in case we need to test
# with development versions
cd $HOME/gap/pkg
for pkg in ${{ inputs.GAP_PKGS_TO_CLONE }}; do
# delete any existing variants of the package to avoid multiple versions
# from being compiled later on
rm -rf "${pkg##*/}"*
if [[ "$pkg" =~ ^http ]] ; then
# looks like a full URL
git clone "$pkg"
elif [[ "$pkg" =~ ^[^/]+/[^/]+$ ]] ; then
# looks like ORG/REPO
git clone https://github.com/"$pkg"
elif [[ "$pkg" =~ ^[^/]+$ ]] ; then
# looks like just a REPO name
git clone https://github.com/gap-packages/"$pkg"
else
echo "Invalid package name or URL '$pkg' in GAP_PKGS_TO_CLONE"
exit 1
fi
done
- name: "Build additional GAP packages"
shell: bash
env:
ABI: ${{ inputs.ABI }}
run: |
# build some packages
BuildPackagesOptions="--strict"
shopt -s nocaseglob
cd $HOME/gap/pkg
for pkg in ${{inputs.GAP_PKGS_TO_BUILD}}; do
../bin/BuildPackages.sh ${BuildPackagesOptions} $pkg*
done