Add the first composite type: Sum #324
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Piff CI | |
on: | |
push: | |
branches: | |
- main | |
- releases/* | |
pull_request: | |
branches: | |
- main | |
- releases/* | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# First all python versions in basic linux | |
os: [ ubuntu-latest ] | |
py: [ 3.7, 3.8, 3.9, "3.10" ] | |
CC: [ gcc ] | |
CXX: [ g++ ] | |
# Add some other particular combinations to test | |
include: | |
# A couple in MacOS | |
- os: macos-latest | |
py: 3.7 | |
CC: cc | |
CXX: c++ | |
- os: macos-latest | |
py: 3.9 | |
CC: cc | |
CXX: c++ | |
# Check one with clang compiler | |
- os: ubuntu-latest | |
py: 3.8 | |
CC: clang | |
CXX: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Helpful for a reliable codecov upload. | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.py }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.py }} | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ matrix.py }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.py }}-pip- | |
${{ runner.os }}- | |
- name: Install libfftw, etc. on linux (needed for GalSim) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo ${{ matrix.os }} | |
sudo -H apt-get -qq update | |
sudo -H apt-get install -y libfftw3-dev libeigen3-dev | |
- name: Install libfftw, etc. on MacOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo ${{ matrix.os }} | |
brew update | true | |
brew install fftw eigen | true | |
- name: Install dependencies with pip | |
run: | | |
python -m pip install -U pip | |
# Do these first to clarify potential conflicts | |
pip install -U setuptools numpy | |
# Standard dependencies | |
pip install -U -r requirements.txt | |
# Extra packages needed for testing | |
# Note: Pin pillow <10 until this bug is fixed: | |
# https://github.com/python-pillow/Pillow/issues/7259 | |
pip install -U nose coverage "pytest<8" nbval ipykernel "pillow<10" | |
- name: Install Pixmappy (not on pip) | |
run: | | |
git clone https://github.com/gbernstein/pixmappy.git | |
cd pixmappy | |
pip install -vvv . | |
cd .. | |
- name: List all installed packages for reference | |
run: pip list | |
- name: Enable Agg backend | |
# The .matplotlib file needs to be in $HOME to work right. | |
run: | | |
cp -r tests/.matplotlib $HOME | |
- name: Build Piff | |
run: pip install -vvv . | |
- name: Run unit tests | |
run: | | |
cd tests | |
coverage run -m pytest -v | |
coverage combine | |
coverage xml | |
ls -lsart | |
cd .. # N.B. This seems to happen automatically if omitted. | |
# Less confusing to include it explicitly. | |
- name: Test Tutorial notebook | |
if: matrix.py == 3.9 | |
run: | | |
cd examples | |
pytest --nbval Tutorial.ipynb --sanitize-with sanitize.cfg --current-env | |
cd .. | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: tests/coverage.xml | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |