Skip to content

Commit 0bb4015

Browse files
committed
add github workflow that checks sdist installation
1 parent 8a5d8aa commit 0bb4015

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Test PnetCDF-C latest official release with source distribution
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**/*.md'
8+
- '**/*.txt'
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- '**/*.md'
14+
- '**/*.txt'
15+
16+
jobs:
17+
build-linux:
18+
name: Python (${{ matrix.python-version }})
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 60
21+
env:
22+
MPICH_VERSION: 4.2.0
23+
MPICH_DIR: ${{ github.workspace }}/mpich-install
24+
PNETCDF_VERSION: 1.13.0
25+
PNETCDF_DIR: ${{ github.workspace }}/PnetCDF-install
26+
strategy:
27+
matrix:
28+
python-version: ["3.10"]
29+
steps:
30+
31+
- uses: actions/checkout@v4
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Install Ubuntu Dependencies
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install m4
42+
43+
- name: Build MPICH
44+
run: |
45+
echo "Install MPICH ${MPICH_VERSION} in $MPICH_DIR"
46+
rm -rf MPICH ; mkdir MPICH ; cd MPICH
47+
wget -q https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz
48+
gzip -dc mpich-${MPICH_VERSION}.tar.gz | tar -xf -
49+
cd mpich-${MPICH_VERSION}
50+
./configure --prefix=$MPICH_DIR \
51+
--silent \
52+
--enable-romio \
53+
--with-file-system=ufs \
54+
--with-device=ch3:sock \
55+
--enable-shared\
56+
--disable-fortran \
57+
CC=gcc
58+
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1
59+
make -s -j 4 distclean >> qout 2>&1
60+
61+
- name: Build PnetCDF-C official release
62+
run: |
63+
echo "Download and build PnetCDF-C release version ${PNETCDF_VERSION}"
64+
wget -q https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
65+
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
66+
pushd pnetcdf-${PNETCDF_VERSION}
67+
./configure --prefix=$PNETCDF_DIR \
68+
--silent \
69+
--enable-shared \
70+
--enable-debug \
71+
--disable-fortran \
72+
--disable-cxx \
73+
--with-mpi=$MPICH_DIR
74+
make -s LIBTOOLFLAGS=--silent V=1 -j 4 install > qout 2>&1
75+
make -s -j 4 distclean >> qout 2>&1
76+
popd
77+
78+
- name: Install python dependencies via pip
79+
run: |
80+
python -m pip install --upgrade pip
81+
pip install numpy cython cftime pytest twine wheel check-manifest
82+
export MPICC=$MPICH_DIR/bin/mpicc
83+
pip install mpi4py
84+
pip install torch
85+
86+
- name: Install PnetCDF-Python from source distribution
87+
run: |
88+
export CC=$MPICH_DIR/bin/mpicc
89+
python setup.py sdist
90+
pip install dist/pnetcdf-*.tar.gz
91+
92+
- name: Test PnetCDF-Python
93+
run: |
94+
export PATH=${MPICH_DIR}/bin:${PATH}
95+
make ptests
96+
97+
# - name: Tarball
98+
# run: |
99+
# export PATH=${NETCDF_DIR}/bin:${PATH}
100+
# python setup.py --version
101+
# check-manifest --version
102+
# check-manifest --verbose
103+
# pip wheel . -w dist --no-deps
104+
# twine check dist/*

0 commit comments

Comments
 (0)