-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (72 loc) · 2.47 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
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, macos-10.15]
python-version: [3.8]
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set release name env variable (ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
echo "UBUNTU_RELEASE=$(lsb_release -sc)" >> $GITHUB_ENV
- 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 "AR=llvm-ar-10" >> $GITHUB_ENV
- 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/setup-python@v2.1.4
with:
python-version: ${{ matrix.python-version }}
- name: Set llvm related envvars (macos)
if: startsWith(matrix.os, 'macos')
run: |
echo "EXTRA_INCLUDE_DIRS=/usr/local/include/" >> $GITHUB_ENV
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L/usr/local/opt/llvm/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I/usr/local/opt/llvm/include" >> $GITHUB_ENV
echo "AR=llvm-ar" >> $GITHUB_ENV
- name: Set clang envvars
if: matrix.compiler == 'clang'
run: |
echo "CC=clang-10" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Set gcc envvars
if: matrix.compiler == 'gcc'
run: |
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
- name: Install python dependencies
env:
PYTHONWARNINGS: ignore:DEPRECATION::pip._internal.cli.base_command
run: |
python -m pip install --upgrade pip
pip install numpy libpy
- name: Build and install from an sdist
run: |
python setup.py sdist
pip install dist/libpy_simdjson-0.4.0.tar.gz[test]
- name: Test
run: |
pytest --ignore-glob='*_benchmark.py'