-
Notifications
You must be signed in to change notification settings - Fork 29
99 lines (96 loc) · 3.22 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04, macos-10.15]
python-version: [3.5, 3.6, 3.8, 3.9]
compiler: [gcc, clang]
exclude:
- os: macos-10.15
compiler: gcc
include:
- python-version: 3.5
numpy: 1.11.3
- python-version: 3.6
numpy: 1.19.3
- python-version: 3.8
numpy: 1.19.3
- python-version: 3.9
numpy: 1.19.3
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set release name env variable (ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
echo ::set-env name=UBUNTU_RELEASE::$(lsb_release -sc)
- name: Install newer clang (ubuntu)
if: startsWith(matrix.os, 'ubuntu') && matrix.compiler == 'clang'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/$UBUNTU_RELEASE/ llvm-toolchain-$UBUNTU_RELEASE-10 main" -y
sudo apt-get update -q
sudo apt-get install -y clang-10 lld-10 libc++-10-dev libc++abi-10-dev clang-tools-10
echo ::set-env name=AR::llvm-ar-10
- name: Install newer clang (macos)
if: startsWith(matrix.os, 'macos') && matrix.compiler == 'clang'
run: |
brew install llvm
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
env:
PYTHONWARNINGS: ignore:DEPRECATION::pip._internal.cli.base_command
run: |
python -m pip install --upgrade pip
pip install pytest==4.4.1 numpy==${{ matrix.numpy }}
- name: Install c++ dependencies (ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get -y install libsparsehash-dev doxygen
- name: Install c++ dependencies (macos)
if: startsWith(matrix.os, 'macos')
run: |
brew install google-sparsehash doxygen
- name: Set llvm related envvars (macos)
if: startsWith(matrix.os, 'macos')
run: |
echo ::set-env name=EXTRA_INCLUDE_DIRS::/usr/local/include/
echo ::add-path::/usr/local/opt/llvm/bin
echo ::set-env name=LDFLAGS::-L/usr/local/opt/llvm/lib
echo ::set-env name=CPPFLAGS::-I/usr/local/opt/llvm/include
echo ::set-env name=AR::llvm-ar
- name: Set clang envvars
if: matrix.compiler == 'clang'
run: |
echo ::set-env name=CC::clang-10
echo ::set-env name=CXX::clang++
- name: Set gcc envvars
if: matrix.compiler == 'gcc'
run: |
echo ::set-env name=CC::gcc-9
echo ::set-env name=CXX::g++-9
- name: Run the tests
run: |
make -j2 test
- name: Build and install from an sdist
run: |
python setup.py sdist
pip install dist/libpy-*.tar.gz
- name: Check that docs can be built
run: |
pip install wheel sphinx sphinx_rtd_theme breathe ipython
make docs