Skip to content

Commit

Permalink
Merge pull request #1 from musevlt/actions
Browse files Browse the repository at this point in the history
Switch to Github Actions
  • Loading branch information
saimn authored Feb 18, 2021
2 parents e9164af + 9f627ca commit d20e6a5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 60 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on: [push, pull_request]

env:
MPDAF_VERSION: '3.5'
CIBW_BEFORE_BUILD: 'bash build-deps.sh'
CIBW_BUILD: 'cp37-* cp38-* cp39-*'
CIBW_ARCHS_LINUX: 'x86_64'
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_LINUX: '
USEOPENMP=0
CFLAGS="-std=c99"
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/project/cfitsio/lib/pkgconfig
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/project/cfitsio/lib'
CIBW_ENVIRONMENT_MACOS: 'CFLAGS="-std=c99"'
CIBW_TEST_REQUIRES: 'pytest numpy==1.19.5'
CIBW_TEST_COMMAND: 'pytest $(dirname $(python -c "import mpdaf; print(mpdaf.__file__)"))'

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.8.0
- name: Prepare
run: |
wget -O- https://files.pythonhosted.org/packages/source/m/mpdaf/mpdaf-$MPDAF_VERSION.tar.gz | tar xz
cp build-deps.sh mpdaf-$MPDAF_VERSION/
# timer tests in test_util fails on macos for some obscure reason,
# so for now let's remove this file
rm mpdaf-$MPDAF_VERSION/lib/mpdaf/tools/tests/test_util.py
- name: Build wheels
run: |
cd mpdaf-$MPDAF_VERSION
python -m cibuildwheel --output-dir ../wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

set -e

pip install -U Cython
# pip install -U Cython

echo "# Downloading cfitsio"
curl -s https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio3370.tar.gz | tar xz
curl https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz | tar xz
echo "# Installing cfitsio"
cd cfitsio
cd cfitsio-3.49
./configure && make clean shared install
cd ..

0 comments on commit d20e6a5

Please sign in to comment.