Skip to content

Commit 04e9d1e

Browse files
authored
Merge pull request #527 from libtom/replace-travis
migrate from travis to GitHub actions
2 parents bea9270 + 17b0fd2 commit 04e9d1e

File tree

4 files changed

+152
-221
lines changed

4 files changed

+152
-221
lines changed

.github/workflows/main.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#############################################################################
2+
# #
3+
# GitHub Actions test-suite for LibTomMath #
4+
# (https://github.com/libtom/libtommath.git) #
5+
# #
6+
#############################################################################
7+
8+
name: CI
9+
10+
# Tests restricted to the following branches of LTM.
11+
on:
12+
push:
13+
branches:
14+
- master
15+
- develop
16+
- /^release\/.*$/
17+
- /^support\/.*$/
18+
- /^ci\/.*$/
19+
pull_request:
20+
branches:
21+
- master
22+
- develop
23+
- /^release\/.*$/
24+
- /^support\/.*$/
25+
- /^ci\/.*$/
26+
27+
jobs:
28+
Build:
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
os: [ ubuntu-18.04 ]
33+
# The environment given to the programs in the build
34+
# We have only one program and the variable $BUILDOPTIONS
35+
# has only the options to that program: testme.sh
36+
37+
config:
38+
# Check c89 <-> c99 roundtrip
39+
- { BUILDOPTIONS: '--c89-c99-roundtrip', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
40+
# Check source code format
41+
- { BUILDOPTIONS: '--format', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'astyle' }
42+
# Check public symbols of dynamic libraries
43+
- { BUILDOPTIONS: '--symbols', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'libtool-bin' }
44+
# Run always with valgrind (no sanitizer, but debug info)
45+
- { BUILDOPTIONS: '--with-cc=gcc --with-m64 --with-valgrind', SANITIZER: '', COMPILE_DEBUG: '1', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
46+
# Shared library build
47+
- { BUILDOPTIONS: '--with-cc=gcc --make-option=-f --make-option=makefile.shared', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '1', CONV_WARNINGS: '', OTHERDEPS: 'gcc-8 libtool-bin' }
48+
# GCC for the 32-bit architecture (no valgrind)
49+
- { BUILDOPTIONS: '--with-cc=gcc --with-m32', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'libc6-dev-i386 gcc-multilib' }
50+
# clang for the 32-bit architecture (no valgrind)
51+
- { BUILDOPTIONS: '--with-cc=clang-7 --with-m32', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-7 llvm-7 gcc-multilib' }
52+
# RSA superclass with tests (no sanitizer, but debug info)
53+
- { BUILDOPTIONS: '--with-cc=gcc-5 --with-m64 --cflags=-DLTM_NOTHING --cflags=-DSC_RSA_1_WITH_TESTS --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '1', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'gcc-5' }
54+
55+
# Test "autotuning", the automatic evaluation and setting of the Toom-Cook cut-offs.
56+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_16BIT --limit-valgrind --make-option=tune'
57+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_32BIT --limit-valgrind --make-option=tune'
58+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --limit-valgrind --make-option=tune'
59+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_16BIT --limit-valgrind --make-option=tune'
60+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_32BIT --limit-valgrind --make-option=tune'
61+
- { BUILDOPTIONS: '--with-cc=clang-7 --limit-valgrind --make-option=tune', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-7 llvm-7' }
62+
63+
# GCC for the x86-64 architecture testing against a different Bigint-implementation
64+
# with 333333 different inputs.
65+
#- env: BUILDOPTIONS='--with-cc=gcc --test-vs-mtest=333333 --limit-valgrind'
66+
# ... and a better random source.
67+
- { BUILDOPTIONS: '--with-cc=gcc --test-vs-mtest=333333 --mtest-real-rand --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
68+
69+
# clang for the x86-64 architecture testing against a different Bigint-implementation
70+
# with 333333 different inputs
71+
- { BUILDOPTIONS: '--with-cc=clang-7 --test-vs-mtest=333333 --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-7 llvm-7' }
72+
# ... and a better random source.
73+
- { BUILDOPTIONS: '--with-cc=clang-7 --test-vs-mtest=333333 --mtest-real-rand --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-7 llvm-7' }
74+
75+
# GCC for the x64_32 architecture (32-bit longs and 32-bit pointers)
76+
# TODO: Probably not possible to run anything in x32 in GH actions
77+
# but needs to be checked to be sure.
78+
- { BUILDOPTIONS: '--with-cc=gcc --with-mx32', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'libc6-dev-x32 gcc-multilib' }
79+
80+
# GCC for the x86-64 architecture (64-bit longs and 64-bit pointers)
81+
- { BUILDOPTIONS: '--with-cc=gcc --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
82+
- { BUILDOPTIONS: '--with-cc=gcc-5 --with-m64 --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'gcc-5' }
83+
- { BUILDOPTIONS: '--with-cc=gcc-4.8 --with-m64 --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'gcc-4.8' }
84+
85+
# clang for x86-64 architecture (64-bit longs and 64-bit pointers)
86+
- { BUILDOPTIONS: '--with-cc=clang-7 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: 'relaxed', OTHERDEPS: 'clang-7 llvm-7' }
87+
- { BUILDOPTIONS: '--with-cc=clang-7 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: 'strict', OTHERDEPS: 'clang-7 llvm-7' }
88+
- { BUILDOPTIONS: '--with-cc=clang-7 --cflags=-DMP_USE_MEMOPS --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: 'strict', OTHERDEPS: 'clang-7 llvm-7' }
89+
- { BUILDOPTIONS: '--with-cc=clang-7 --c89 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: 'strict', OTHERDEPS: 'clang-7 llvm-7' }
90+
- { BUILDOPTIONS: '--with-cc=clang-7 --with-m64 --limit-valgrind --cflags=-DMP_PREC=MP_MIN_PREC', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-7 llvm-7' }
91+
- { BUILDOPTIONS: '--with-cc=clang-10 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-10 llvm-10' }
92+
- { BUILDOPTIONS: '--with-cc=clang-9 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-9 llvm-9' }
93+
- { BUILDOPTIONS: '--with-cc=clang-8 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-8 llvm-8' }
94+
- { BUILDOPTIONS: '--with-cc=clang-6.0 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-6.0 llvm-6.0' }
95+
- { BUILDOPTIONS: '--with-cc=clang-5.0 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-5.0 llvm-5.0' }
96+
- { BUILDOPTIONS: '--with-cc=clang-4.0 --with-m64 --limit-valgrind', SANITIZER: '', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang-4.0 llvm-4.0' }
97+
# Link time optimization
98+
- { BUILDOPTIONS: '--with-cc=gcc --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '1', CONV_WARNINGS: '', OTHERDEPS: '' }
99+
#- { BUILDOPTIONS: '--with-cc=clang-7 --with-m64 --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '1', CONV_WARNINGS: '', OTHERDEPS: '' }
100+
101+
# GCC for the x86-64 architecture with restricted limb sizes
102+
# formerly started with the option "--with-low-mp" to testme.sh
103+
# but testing all three in one run took to long and timed out.
104+
- { BUILDOPTIONS: '--with-cc=gcc --cflags=-DMP_16BIT --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
105+
- { BUILDOPTIONS: '--with-cc=gcc --cflags=-DMP_32BIT --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: '' }
106+
# clang for the x86-64 architecture with restricted limb sizes
107+
- { BUILDOPTIONS: '--with-cc=clang --cflags=-DMP_16BIT --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang llvm' }
108+
- { BUILDOPTIONS: '--with-cc=clang --cflags=-DMP_32BIT --limit-valgrind', SANITIZER: '1', COMPILE_DEBUG: '0', COMPILE_LTO: '0', CONV_WARNINGS: '', OTHERDEPS: 'clang llvm' }
109+
steps:
110+
- uses: actions/checkout@v2
111+
- name: install dependencies
112+
run: |
113+
sudo apt-get update -qq
114+
sudo apt-get install -y valgrind ${{ matrix.config.OTHERDEPS }}
115+
sudo apt-cache search gcc | grep '^gcc-[0-9\.]* '
116+
sudo apt-cache search clang | grep compiler
117+
- name: run tests
118+
env:
119+
SANITIZER: ${{ matrix.config.SANITIZER }}
120+
COMPILE_DEBUG: ${{ matrix.config.COMPILE_DEBUG }}
121+
COMPILE_LTO: ${{ matrix.config.COMPILE_LTO }}
122+
CONV_WARNINGS: ${{ matrix.config.CONV_WARNINGS }}
123+
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
124+
PR_NUMBER: ${{ github.event.number }}
125+
# The actual script the jobs run.
126+
run: |
127+
./testme.sh ${{ matrix.config.BUILDOPTIONS }}
128+
# In case of a CI error a success might get signaled
129+
# even without any test run. This file also keeps any notes
130+
# printed from the tests which might come handy from time
131+
# to time.
132+
# Valgrid will print its output to stderr which will not show up
133+
# in test_*.log. testme.sh accepts one additional option to
134+
# valgrind and "--valgrind-options=--log-fd=1" sends the output
135+
# of Valgrind to stdout instead.
136+
- name: regular logs
137+
if: ${{ !failure() }}
138+
run: |
139+
cat test_*.log || true
140+
# Compilation failures are in gcc_errors_*.log
141+
# Failed tests in test_*.log
142+
# Files do not exist in case of success
143+
- name: error logs
144+
if: ${{ failure() }}
145+
run: |
146+
cat test_*.log || true
147+
cat valgrind_test.log || true
148+
cat gcc_errors_*.log || true

0 commit comments

Comments
 (0)