bump version #213
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: batoid CI | |
on: | |
push: | |
branches: | |
- main | |
- releases/* | |
pull_request: | |
branches: | |
- main | |
- releases/* | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
py: [3.8, 3.9, '3.10', 3.11] | |
CC: [ gcc ] | |
CXX: [ g++ ] | |
include: | |
- os: macos-latest | |
py: 3.8 | |
CC: cc | |
CXX: c++ | |
- os: ubuntu-latest | |
py: 3.8 | |
CC: clang | |
CXX: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 2 | |
- name: Print github context properties | |
run: | | |
echo 'event: ${{ github.event_name }}' | |
echo 'sha: ${{ github.sha }}' | |
echo 'ref: ${{ github.ref }}' | |
echo 'head_ref: ${{ github.head_ref }}' | |
echo 'base_ref: ${{ github.base_ref }}' | |
echo 'event.before: ${{ github.event.before }}' | |
echo 'event.after: ${{ github.event.after }}' | |
- 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 | |
$HOME/Library/Caches/Homebrew | |
/usr/local/Cellar | |
key: ${{ runner.os }}-${{ matrix.py }}-${{ matrix.CXX}}-pip-${{ hashFiles('requirements.txt') }} | |
- 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: | | |
# brew update takes forever to run. Hopefully won't need to enable this too often. | |
# Note: The || true bit here is because brew returns an error code if everything is | |
# already installed, which is goofy. So || true means these always give | |
# non-error values. If there really is an error, we should notice later | |
# when trying to use whatever package failed to install. | |
#brew update || true | |
brew install fftw wget || true | |
brew upgrade wget || true | |
brew link --overwrite fftw gcc wget || true | |
brew install eigen || true | |
brew link --overwrite eigen || true | |
- name: Install dependencies | |
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 | |
# Use pybind11-global to make CMake files visible | |
pip install -U pybind11-global | |
- name: Install remaining dependencies | |
run: | | |
pip install -U -r test_requirements.txt | |
- name: List all installed packages for reference | |
run: pip list | |
- name: Build batoid | |
run: CMAKE_VERBOSE_MAKEFILE=1 python setup.py develop | |
- name: Run unit tests | |
run: pytest --cov=batoid --cov-report=xml --cov-config tests/.coveragerc --skip_gha --durations=8 -ra | |
- name: Upload coverage to codecov | |
run: | | |
pwd -P | |
ls -la | |
env | |
coverage combine || true # (Not necessary I think, but just in case.) | |
coverage report | |
ls -la | |
bash <(curl -s https://codecov.io/bash) | |
- name: Pre-cache cleanup | |
continue-on-error: true | |
run: | | |
# This was helpful in Travis. Not sure how important it is in GHA. | |
rm -rfv $HOME/.cache/pip/log | |
rm -rfv $HOME/.cache/pip/http | |
if ${{ runner.os == 'macOS' }}; then brew cleanup || true; fi |