Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 41 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
name: PyFHD pytest

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.10.17, 3.11.12, 3.12.7, 3.13.3]
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest] #, windows-latest] add back after healpy replaced
uv-options: ["--frozen"]
include:
- uv-options: "--upgrade"
os: ubuntu-latest
python-version: "3.13"
- uv-options: "--resolution lowest-direct"
os: ubuntu-latest
python-version: "3.11"
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -23,14 +33,19 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: uv sync --frozen --all-extras --dev
run: uv sync ${{ matrix.uv-options }} --all-extras --dev

- name: Environment Info
run: |
uv pip list

- name: Cache test data
id: cache-test-data
uses: actions/cache@v4
with:
path: PyFHD/resources/test_data/pyfhd_test_data.zip
key: test-data-${{ hashFiles('**/pyfhd_test_data.zip') }}
restore-keys: test-data-

- name: Download the test data from Zenodo
if: steps.cache-test-data.outputs.cache-hit != 'true'
Expand All @@ -42,25 +57,40 @@ jobs:
unzip PyFHD/resources/test_data/pyfhd_test_data.zip -d PyFHD/resources/test_data

- name: Run tests
run: uv run coverage run --branch --source=PyFHD -m pytest -m github_actions --html=pyfhd_report.html --self-contained-html
run: |
uv run coverage run --branch --source=PyFHD -m pytest -m github_actions --html=pyfhd_report.html --self-contained-html
uv run coverage xml -o ./coverage.xml

- name: check coverage report
run: |
ls
cat coverage.xml

- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{ secrets.CODECOV_TOKEN }} #required
files: ./coverage.xml #optional

- name: Get coverage HTML report
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && matrix.uv-options == '--frozen')
run: uv run coverage html --directory=coverage_html_report --title="PyFHD GitHub Actions Coverage Report"

- name: Change Title of the Unit Test Report
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && matrix.uv-options == '--frozen')
run: |
sed -i 's/<h1 id="title">pyfhd_report.html<\/h1>/<h1 id="title">PyFHD GitHub Actions Unit Test Report<\/h1>/' pyfhd_report.html
sed -i 's/<title id="head-title">pyfhd_report.html<\/title>/<title id="head-title">PyFHD GitHub Actions Unit Test Report<\/title>/' pyfhd_report.html

- name: Upload Unit Test HTML Report
if: ${{ matrix.python-version == '3.13.3' }}
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && matrix.uv-options == '--frozen')
uses: actions/upload-artifact@v4
with:
name: unit-test-report
path: pyfhd_report.html

- name: Upload Coverage HTML Report Directory
if: ${{ matrix.python-version == '3.13.3' }}
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && matrix.uv-options == '--frozen')
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
Expand Down
28 changes: 14 additions & 14 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ channels:
- conda-forge
- defaults
dependencies:
- python
- astropy
- configargparse
- matplotlib
- numba
- numpy
- pytest
- scipy
- astropy>=6.1.7
- black
- colorama>=0.4.6
- configargparse>=1.7
- h5py>=3.13.0
- importlib_resources>=6.5.2
- matplotlib>=3.10.3
- numba>=0.61.2
- numpy>=2.2.5
- pyuvdata>=3.2.1
- pytest>=8.3.5
- scipy>=1.15.3
- setuptools
- sphinx
- colorama
- importlib_resources
- h5py
- sphinx>=8.1.3
- pre-commit
- black
- pip
- pyinstrument
- pip:
Expand All @@ -28,5 +28,5 @@ dependencies:
- pytest-html
- pytest-html-merger
- myst-parser
- healpy
- healpy>=1.18.1

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
{ name = "Jack Line (JLBLine)", email = "jack.line@curtin.edu.au"},
{ name = "Nichole Barry (nicholebarry)", email = "nichole.barry@unsw.edu.au"}
]
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
Expand Down
Loading