forked from Tencent/rapidjson
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (135 loc) · 4.23 KB
/
test-suite.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
name: Test of package installation & execution
'on':
push:
branches-ignore:
- gh-pages
tags:
- '*'
schedule:
- cron: 0 10 * * 1
jobs:
build_pip:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-install: [pip]
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
submodules: true
- name: Patch gtest
run: |
cd thirdparty/gtest
git apply ../gtest.patch
cd ../..
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libc6-dbg gdb valgrind
sudo apt upgrade --fix-missing
valgrind --version
# sudo apt autoremove -y
# sudo apt autoclean -y
- name: Setup Python
uses: actions/setup-python@v2
- name: Fix Python path on mac
if: matrix.os == 'macos-latest'
run: |
tee -a ~/.profile <<<'export PATH="${pythonLocation}/bin:${PATH}"'
- name: Install Python dependencies
run: python -m pip install -r requirements.txt
- name: Check for numpy
run: |
python -c "import sys; print(sys.executable)"
python -c "import numpy; print(numpy.get_include())"
- name: Configure
if: matrix.os == 'windows-latest'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DPython3_ROOT_DIR=$env:pythonLocation -DRAPIDJSON_YGGDRASIL_TESTS=ON
- name: Configure
if: matrix.os != 'windows-latest'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DPython3_ROOT_DIR=${pythonLocation} -DRAPIDJSON_ENABLE_INSTRUMENTATION_OPT=OFF -DRAPIDJSON_YGGDRASIL_TESTS=ON -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=ON
- name: Build
run: |
cd build
cmake --build . --config Debug
- name: Test
run: |
cd build
ctest -C Debug --output-on-failure --verbose
build_conda:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-install: [conda]
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
submodules: true
- name: Patch gtest
run: |
cd thirdparty/gtest
git apply ../gtest.patch
cd ../..
- name: Set up MSVC Compiler on windows
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
with:
toolset: 14.0
- name: Set up miniconda test environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: rapidjson
environment-file: environment.yml
auto-update-conda: true
channels: conda-forge
channel-priority: strict
miniforge-variant: Mambaforge
use-mamba: true
- name: Check for numpy
run: |
python -c "import sys; print(sys.executable)"
python -c "import numpy; print(numpy.get_include())"
- name: Configure
if: matrix.os == 'windows-latest'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DRAPIDJSON_ENABLE_COVERAGE=ON
- name: Configure
if: matrix.os != 'windows-latest'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DRAPIDJSON_ENABLE_COVERAGE=ON -DRAPIDJSON_YGGDRASIL_TESTS=ON -DRAPIDJSON_CREATE_METASCHEMA=ON
- name: Build
run: |
cd build
cmake --build . --config Debug
- name: Test
run: |
cd build
ctest -C Debug --output-on-failure --verbose
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.os }}-${{ matrix.python-install }}
token: ${{ secrets.CODECOV_TOKEN }}
file: build/coverage/coverage.info
# directory: build/Testing/CoverageInfo
functionalities: gcov