Skip to content

Commit

Permalink
add cache of hdf5 and libaes source
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Nov 24, 2023
1 parent 89fcfe3 commit 191a74b
Showing 1 changed file with 64 additions and 24 deletions.
88 changes: 64 additions & 24 deletions .github/workflows/publish-sdist-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ on: [pull_request, push]

env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: 'cp*'
CIBW_BUILD: 'cp310-*'
#CIBW_BUILD: 'cp*'
CIBW_SKIP: 'cp35-* cp36-* *-manylinux_i686 *-musllinux_* *-win32 cp311-macosx_x86_64'
CIBW_BEFORE_TEST: pip install -r {project}/tests/requirement_tests.txt
CIBW_TEST_COMMAND: pytest -s -v {project}/tests
AEC_VERSION: "1.0.4"
HDF5_VERSION: "1.12.1"

jobs:
build_wheels:
Expand All @@ -17,15 +20,45 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
os: [macos-11 ]
#os: [ubuntu-20.04, macos-11, windows-2022]

steps:
- name: Cache HDF5 On Linux/macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: actions/cache@v3
id: cache-hdf5-posix
env:
cache-name: cache-hdf5-posix
with:
path: src-cache/
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Fill HDF5 On Linux/macOS Cache
if: runner.os == 'Linux' || runner.os == 'macOS' && steps.cache-hdf5-posix.outputs.cache-hit != 'true'
continue-on-error: false
run: |
pwd
mkdir -p src-cache/
cd src-cache/
echo "Downloading & unpacking aec ${AEC_VERSION}"
curl -fsSLO https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-${AEC_VERSION}.tar.gz
tar zxvf libaec-$AEC_VERSION.tar.gz
echo "Downloading & unpacking HDF5 ${HDF5_VERSION}"
curl -fsSLO "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz"
tar xzvf hdf5-$HDF5_VERSION.tar.gz
ls -al
pwd
- uses: actions/checkout@v3
with:
submodules: 'true'

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

Expand All @@ -38,31 +71,19 @@ jobs:
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_ALL: |
AEC_VERSION="1.0.4"
HDF5_VERSION="1.12.1"
yum update -y
#yum update -y
yum -y install zlib-devel
pushd /tmp
echo "Downloading & unpacking aec ${AEC_VERSION}"
curl -fsSLO https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-${AEC_VERSION}.tar.gz
tar zxf libaec-$AEC_VERSION.tar.gz
echo "Building & installing libaec"
pushd libaec-$AEC_VERSION
pushd /host/opt/src/libaec-${{env.AEC_VERSION}}
./configure
make -j 2
make install
ldconfig
popd
echo "Downloading & unpacking HDF5 ${HDF5_VERSION}"
curl -fsSLO "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz"
tar -xzvf hdf5-$HDF5_VERSION.tar.gz
echo "Building & installing HDF5"
pushd hdf5-$HDF5_VERSION
pushd /host/opt/src/hdf5-${{env.HDF5_VERSION}}
./configure \
--prefix=/usr \
--enable-build-mode=production \
Expand All @@ -73,6 +94,7 @@ jobs:
make install
ldconfig
popd
run: |
python -m cibuildwheel --output-dir dist
Expand All @@ -81,11 +103,29 @@ jobs:
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
CIBW_BEFORE_BUILD: |
#brew update
#brew --version
export HOMEBREW_NO_AUTO_UPDATE=1
export HDF5_DIR="$(brew --prefix hdf5)";
brew install hdf5
pwd
ls -al
cd src-cache/
ls -al
echo "Building & installing libaec"
pushd libaec-${{env.AEC_VERSION}}
./configure
make -j 2
make install
popd
echo "Building & installing HDF5"
pushd hdf5-${{env.HDF5_VERSION}}
./configure \
--prefix=/usr \
--enable-build-mode=production \
--with-szlib \
--enable-tools=no \
--enable-tests=no
make -j 2
make install
popd
run: |
python -m cibuildwheel --output-dir dist
Expand Down

0 comments on commit 191a74b

Please sign in to comment.