Merge pull request #53 from darshan-hpc/snyder/update-ci-python-versions #104
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: Python Testing | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
test_log_repo: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, | |
macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# install this (logs) project | |
- name: Install darshan_logs package | |
run: | | |
python -m pip install . | |
- name: obtain pydarshan | |
run: | | |
mkdir scratch | |
cd scratch | |
git clone https://github.com/darshan-hpc/darshan.git | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade pytest | |
python -m pip install --upgrade lxml matplotlib | |
- if: ${{matrix.platform == 'macos-latest'}} | |
name: Install MacOS deps | |
run: | | |
brew install automake | |
brew install libtool | |
- name: Install darshan-util | |
run: | | |
cd scratch/darshan | |
mkdir darshan_install | |
export DARSHAN_INSTALL_PATH=$PWD/darshan_install | |
git submodule update --init | |
./prepare.sh | |
cd darshan-util | |
./configure --prefix=$DARSHAN_INSTALL_PATH --enable-apxc-mod --enable-apmpi-mod | |
make | |
make install | |
- name: Install pydarshan | |
run: | | |
cd scratch/darshan/darshan-util/pydarshan | |
python -m pip install . | |
# shim for importlib.resources on Python < 3.9 | |
- if: ${{matrix.python-version < 3.9}} | |
name: Install importlib_resources | |
run: | | |
python -m pip install -U importlib_resources | |
# this should detect PRs that attempt to add log | |
# files that cannot be read by the main repo | |
- name: Run pytest to check for bad logs | |
run: | | |
export LD_LIBRARY_PATH=$PWD/scratch/darshan/darshan_install/lib | |
export DYLD_FALLBACK_LIBRARY_PATH=$PWD/scratch/darshan/darshan_install/lib | |
# the test suite is sensitive to | |
# relative dir for test file paths | |
cd scratch/darshan/darshan-util/pydarshan | |
pytest --import-mode=importlib |