-
Notifications
You must be signed in to change notification settings - Fork 66
130 lines (122 loc) · 4.43 KB
/
main.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
#############################################################################
# #
# GitHub Actions test-suite for TomsFastMath #
# (https://github.com/libtom/tomsfastmath.git) #
# #
#############################################################################
name: CI
# Tests restricted to the following branches.
on:
push:
branches:
- master
- develop
- /^release\/.*$/
- /^support\/.*$/
- /^ci\/.*$/
pull_request:
branches:
- master
- develop
- /^release\/.*$/
- /^support\/.*$/
- /^ci\/.*$/
jobs:
Testme:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
# The environment given to the programs in the build
# We have only one program and the variable $BUILDOPTIONS
# has only the options to that program: testme.sh
config:
# GCC for the x86-64 architecture (64-bit longs and 64-bit pointers)
- { CC: 'gcc', DEPS: 'gcc' }
- { CC: 'gcc-10', DEPS: 'gcc-10' }
- { CC: 'gcc-8', DEPS: 'gcc-8' }
- { CC: 'gcc-7', DEPS: 'gcc-7' }
# clang for x86-64 architecture (64-bit longs and 64-bit pointers)
- { CC: 'clang', DEPS: 'clang' }
- { CC: 'clang-10', DEPS: 'clang-10 llvm-10' }
- { CC: 'clang-12', DEPS: 'clang-12 llvm-12' }
- { CC: 'clang-9', DEPS: 'clang-9 llvm-9' }
- { CC: 'clang-8', DEPS: 'clang-8 llvm-8' }
- { CC: 'clang-7', DEPS: 'clang-7 llvm-7' }
- { CC: 'clang-6.0', DEPS: 'clang-6.0 llvm-6.0' }
makefile: [ makefile, makefile.shared ]
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install libtool-bin -y ${{ matrix.config.DEPS }}
sudo apt-cache search gcc | grep '^gcc-[0-9\.]* '
sudo apt-cache search clang | grep compiler
- name: run tests
env:
CC: ${{ matrix.config.CC }}
run: |
$CC -dumpversion
make -f ${{ matrix.makefile }} test_standalone >gcc_errors_1.log 2>gcc_errors_2.log
./test >test_std.log 2>test_err.log
# In case of a CI error a success might get signaled
# even without any test run. This file also keeps any notes
# printed from the tests which might come handy from time
# to time.
- name: regular logs
if: ${{ !failure() }}
run: |
cat test_*.log || true
# Compilation failures are in gcc_errors_*.log
# Failed tests in test_*.log
# Files do not exist in case of success
- name: error logs
if: ${{ failure() }}
run: |
cat test_*.log || true
cat gcc_errors_*.log || true
amalgam:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: build stest with amalgamated sources
run: |
make amalgamated_stest
CMake:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
build_type: [ '', -DCMAKE_BUILD_TYPE=Debug, -DCMAKE_BUILD_TYPE=Release, -DCMAKE_BUILD_TYPE=RelWithDebInfo, -DCMAKE_BUILD_TYPE=MinSizeRel ]
cc: [ clang, gcc ]
config:
# Static library build
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=Off' }
# Shared library build
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=On' }
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake gcc clang llvm
- name: build
run: |
mkdir build
cd build
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
make -j$(nproc)
- name: test
run: |
cd build
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} -DBUILD_TESTING=On ..
make -j$(nproc)
ctest
- name: test (in demo folder)
run: |
mkdir -p demo/build
cd demo/build
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
make -j$(nproc)
ctest