Skip to content

test conda build

test conda build #2212

Workflow file for this run

name: Python package
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: |
~/.cache/pip
${{ env.pythonLocation }}/bin/*
${{ env.pythonLocation }}/include
${{ env.pythonLocation }}/lib/python*/site-packages/*
!${{ env.pythonLocation }}/bin/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/pip*
!${{ env.pythonLocation }}/lib/python*/site-packages/setuptools*
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install CXX Dependencies
run: sudo apt-get update && sudo apt-get install -yq gfortran libboost-dev libboost-serialization-dev liblapack-dev
- name: Install MongoDB
uses: supercharge/mongodb-github-action@1.3.0
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade --upgrade-strategy eager pytest pytest-cov
if [ -f requirements.txt ]; then pip install --upgrade --upgrade-strategy eager -r requirements.txt; fi
- name: Install Apache Spark
run: |
mkdir -p /opt
wget -q -O /opt/spark.tgz https://archive.apache.org/dist/spark/spark-3.0.0/spark-3.0.0-bin-hadoop2.7.tgz
tar xzf /opt/spark.tgz -C /opt/
rm /opt/spark.tgz
export SPARK_HOME=/opt/spark-3.0.0-bin-hadoop2.7
echo "SPARK_HOME=/opt/spark-3.0.0-bin-hadoop2.7" >> $GITHUB_ENV
export PATH=$PATH:/opt/spark-3.0.0-bin-hadoop2.7/bin
echo "/opt/spark-3.0.0-bin-hadoop2.7/bin" >> $GITHUB_PATH
python -m pip install --upgrade --upgrade-strategy eager pyspark pytest-spark
- name: Install
run: python -m pip install -C--global-option=build -C--global-option=--debug -v .
- name: Test with pytest
run: |
export MSPASS_HOME=$(pwd)
export SPARK_LOCAL_IP=127.0.0.1
pytest --cov=mspasspy python/tests/
make test -C build/temp.*/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }} # required
env_vars: OS,PYTHON
verbose: true
- name: Build Documentation
if: ${{ matrix.python-version == '3.8' }}
run: |
export MSPASS_HOME=$(pwd)
sudo apt-get update && sudo apt-get install -yq doxygen pandoc
pip install -r docs/requirements.txt
cd docs
ls
make html
- name: Deploy to GitHub Pages
if: ${{ github.ref == 'refs/heads/master' && matrix.python-version == '3.8' }}
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: false