Skip to content

Merge branch 'master' into trq/starlog_tcoolform #8

Merge branch 'master' into trq/starlog_tcoolform

Merge branch 'master' into trq/starlog_tcoolform #8

Workflow file for this run

name: Build and Test
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
numpy-version: ["~=1.22.4", ""]
exclude:
- python-version: "3.12"
numpy-version: "~=1.22.4"
runs-on: ${{ matrix.os }}
env:
C: gcc-10
CXX: g++-10
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Cache testdata
uses: actions/cache@v3
id: cache-testdata
with:
path: tests/testdata
key: testdata-v6
- name: Install gcc
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt install -y gcc-10 g++-10
- name: Install prerequisites
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install numpy${{ matrix.numpy-version }}
- name: Build and install pynbody
run: |
python -m pip install -v .[tests]
echo "[ramses]" >> ~/.pynbodyrc
echo "parallel-read=2" >> ~/.pynbodyrc
- name: Fetch and unpack test data
if: steps.cache-testdata.outputs.cache-hit != 'true'
working-directory: tests
run: |
wget -q http://star.ucl.ac.uk/~app/testdata.tar.gz
tar --exclude="._*" -xzvf testdata.tar.gz
- name: Run all tests
working-directory: tests
run: python -m pytest
- name: Upload test images
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: images-${{ matrix.python-version }}-${{ matrix.numpy-version }}
path: tests/result*.npy