-
Notifications
You must be signed in to change notification settings - Fork 5
115 lines (115 loc) · 4.14 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
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: |
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: |
python3 -m pip install meson 'numpy<2' sphinx breathe sphinx_rtd_theme pytest pytest-tap
meson setup build . -D b_coverage=true --prefix=${HOME}/inst/
meson test -C build
- name: Rename TestLog
if: always() && matrix.build == 'meson'
run: |
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: |
meson install -C build
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 }}
publish-test-results:
name: "Publish Tests Results"
needs: [Tests, cvmfs_meson_tests, cvmfs_pyproject_tests]
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: .
pattern: test-results-*
merge-multiple: true
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "*.xml"
deduplicate_classes_by_file_name: true