-
Notifications
You must be signed in to change notification settings - Fork 5
155 lines (155 loc) · 5.95 KB
/
tests.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
actions: read
checks: write
jobs:
Tests:
name: ${{matrix.os}} ${{matrix.build}} tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-14]
build: [meson, pyproject]
include:
- os: ubuntu-20.04
python-version: "3.8"
- os: ubuntu-22.04
python-version: "3.10"
- os: macos-12
python-version: "3.12"
- os: macos-14
python-version: "3.12"
steps:
- name: Checkout nuflux
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Apt-Get Install Dependencies
if: startsWith( matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install ninja-build gcovr libcfitsio-dev libboost-python-dev doxygen
curl -L https://github.com/icecube/photospline/archive/refs/tags/v2.2.1.tar.gz | tar xz
cmake -S photospline-2.2.1 -B photospline -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
sudo make install -C photospline
- name: HomeBrew Install Dependencies
if: startsWith( matrix.os, 'macos')
run: |
brew tap icecube/icecube
brew install boost-python3 ninja doxygen cfitsio gcovr icecube/icecube/photospline
echo BOOST_ROOT=$(brew --prefix) >> "$GITHUB_ENV"
- name: Build nuflux with pyproject
if: matrix.build == 'pyproject'
run: |
echo "BOOST_ROOT: ${BOOST_ROOT}"
python3 -m pip install .[test]
python3 -m pytest --junit-xml=test-results-${{matrix.build}}-${{matrix.os}}.junit.xml
- name: Build nuflux with Meson
if: matrix.build == 'meson'
run: |
echo "BOOST_ROOT: ${BOOST_ROOT}"
python3 -m pip install meson numpy sphinx breathe sphinx_rtd_theme pytest pytest-tap
meson setup build . -D b_coverage=true --prefix=${HOME}/inst/
ninja -C build test
mv -v build/meson-logs/testlog.junit.xml test-results-${{matrix.build}}-${{matrix.os}}.junit.xml
- uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: test-results-${{matrix.build}}-${{matrix.os}}
path: test-results-${{matrix.build}}-${{matrix.os}}.junit.xml
- name: Install and test linking
if: matrix.build == 'meson' && startsWith( matrix.os, 'macos')
env:
PKG_CONFIG_PATH: /Users/runner/inst/lib/pkgconfig
run: |
ninja -C build install
c++ -std=c++17 $(pkg-config nuflux --cflags --libs) -I$(brew --prefix)/include tests/test_basic.cxx -o test_basic
./test_basic
- name: Generate Coverage Report and Docs
if: matrix.build == 'meson' && startsWith( matrix.os, 'ubuntu')
run: |
ninja -C build coverage
ninja -C build docs/html
- name: Upload Coverage to Codecov
if: matrix.build == 'meson' && startsWith( matrix.os, 'ubuntu')
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
verbose: true
- name: Upload Documentation
if: matrix.build == 'meson' && startsWith( matrix.os, 'ubuntu') && github.ref == 'refs/heads/main'
run: docs/docs-upload.sh
env:
ICECUBE_PASSWORD: ${{ secrets.ICECUBE_PASSWORD }}
# cvmfs_meson_tests:
# name: cvmfs meson tests ${{matrix.cvmfs}}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# cvmfs: [py3-v4.1.1, py3-v4.2.1, py3-v4.3.0]
# steps:
# - uses: cvmfs-contrib/github-action-cvmfs@v3
# - name: Checkout nuflux
# uses: actions/checkout@v4
# - name: Build and Run Tests in Docker
# uses: addnab/docker-run-action@v3
# with:
# options: -v /cvmfs/icecube.opensciencegrid.org/:/cvmfs/icecube.opensciencegrid.org/ -v /home/runner/work/nuflux/nuflux:/nuflux
# image: centos:centos7.9.2009
# run: |
# yum -y install glibc-headers glibc-devel unzip
# eval $(/cvmfs/icecube.opensciencegrid.org/${{matrix.cvmfs}}/setup.sh)
# export PATH=${HOME}/.local/bin:${PATH}
# pip install --upgrade --user meson ninja pytest pytest-tap
# CMAKE_PREFIX_PATH=${SROOT} BOOST_ROOT=${SROOT} meson setup build /nuflux
# ninja -Cbuild test
# cvmfs_pyproject_tests:
# name: cvmfs pyproject tests ${{matrix.cvmfs}}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# cvmfs: [py3-v4.1.1, py3-v4.3.0]
# steps:
# - uses: cvmfs-contrib/github-action-cvmfs@v3
# - name: Checkout nuflux
# uses: actions/checkout@v4
# - name: Build and Run Tests in Docker
# uses: addnab/docker-run-action@v3
# with:
# options: -v /cvmfs/icecube.opensciencegrid.org/:/cvmfs/icecube.opensciencegrid.org/ -v /home/runner/work/nuflux/nuflux:/nf
# image: centos:centos7.9.2009
# run: |
# yum -y install glibc-headers glibc-devel
# eval $(/cvmfs/icecube.opensciencegrid.org/${{matrix.cvmfs}}/setup.sh)
# python3 -m pip install --upgrade --user pip pytest pytest-tap
# BOOST_ROOT=${SROOT} python3 -m pip install --user --verbose /nf
# python3 -m pytest /nf
test_report:
needs: [Tests]
runs-on: ubuntu-latest
if: always()
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: test-results
pattern: test-results-*
merge-multiple: true
- name: Test Report
uses: dorny/test-reporter@v1
with:
name: Test Results
path: test-results/test-results-meson-*.xml
reporter: jest-junit