-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (141 loc) · 4.55 KB
/
tests.yml
File metadata and controls
141 lines (141 loc) · 4.55 KB
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
# SPDX-FileCopyrightText: © 2022 the SimWeights contributors
#
# SPDX-License-Identifier: BSD-2-Clause
name: Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Tests:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-24.04]
include:
- python-version: "3.13"
os: macos-13
- python-version: "3.13"
os: macos-14
- python-version: "3.13"
os: macos-15
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install SimWeights
run: uv pip install -e .[test]
- name: Download Test Data
run: |
curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
tar xzvf simweights_testdata.tar.gz
- name: Run Tests
env:
SIMWEIGHTS_TESTDATA: .
run: python3 -m pytest --cov-report=xml --junit-xml=test-results-${{matrix.os}}-${{matrix.python-version}}.junit.xml
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: test-results-${{matrix.os}}-${{matrix.python-version}}
path: test-results-${{matrix.os}}-${{matrix.python-version}}.junit.xml
- name: Upload Coverage to Codecov
if: ${{ !github.event.act }}
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
TestsIceTray:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-latest
container: icecube/icetray:icetray-devel-current-ubuntu22.04-X64
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install SimWeights
run: uv pip install -e .[test]
- name: Download Test Data
run: |
curl -u icecube:${{ secrets.ICECUBE_PASSWORD }} https://convey.icecube.wisc.edu/data/ana/Software/simweights/test-data/simweights_testdata.tar.gz -O
tar xzvf simweights_testdata.tar.gz
- name: Run Unit Tests
env:
SIMWEIGHTS_TESTDATA: .
run: /opt/icetray/bin/icetray-shell python -m pytest --junit-xml=test-results-icetray.junit.xml
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: test-results-icetray.junit.xml
path: test-results-icetray.junit.xml
publish-test-results:
name: "Publish Tests Results"
needs: Tests
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v5
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
Docs:
env:
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: |
uv pip install .[docs]
- name: Run Sphinx
working-directory: ./docs
run: make html
- name: Upload docs to docs.icecube.aq
if: ${{ github.ref_name == 'main' && !github.event.act }}
working-directory: ./docs
run: |
tar -czvf simweights_docs.tar.gz -C_build/html .
curl -XPUT -i --data-binary @simweights_docs.tar.gz https://docs.icecube.aq/api/upload?path=simweights/${{ github.ref_name }} -u icecube:${{ secrets.ICECUBE_PASSWORD }}