Merge pull request #122 from pysat/maint/meta_header #666
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Pytest with Flake8 | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.11", "3.12"] | |
numpy_ver: ["latest"] | |
include: | |
- python-version: "3.10" | |
numpy_ver: "1.24" | |
os: "ubuntu-latest" | |
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Reinstall fortran on MacOS | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: brew reinstall gcc | |
- name: Install NEP29 dependencies | |
if: ${{ matrix.numpy_ver != 'latest'}} | |
run: | | |
pip install .[test] | |
pip install scipy==1.13.1 | |
pip install numpy==${{ matrix.numpy_ver }} | |
- name: Install standard dependencies | |
if: ${{ matrix.numpy_ver == 'latest'}} | |
run: pip install .[test] | |
- name: Install aacgmv2 | |
# Optional package, continue with tests if install fails | |
continue-on-error: true | |
run: pip install aacgmv2 --no-binary==aacgmv2 | |
- name: Install apexpy for MacOS X | |
# Only test apexpy for NEP29 tests | |
if: ${{ matrix.numpy_ver != 'latest' && matrix.os == 'macos-latest' }} | |
# Optional package, continue with tests if install fails | |
continue-on-error: true | |
run: | | |
brew reinstall gcc | |
/opt/homebrew/bin/gfortran --version | |
/opt/homebrew/bin/gcc-14 --version | |
CC=/opt/homebrew/bin/gcc-14 FC=/opt/homebrew/bin/gfortran pip install apexpy --no-binary==apexpy | |
- name: Install apexpy for Unix/Windows | |
# Only test apexpy for NEP29 tests | |
if: ${{ matrix.numpy_ver != 'latest' && matrix.os != 'macos-latest' }} | |
# Optional package, continue with tests if install fails | |
continue-on-error: true | |
run: pip install apexpy --no-binary==apexpy | |
- name: Install OMMBV | |
# Optional package, continue with tests if install fails | |
continue-on-error: true | |
run: pip install OMMBV --no-binary==OMMBV | |
- name: Set up pysat | |
run: | | |
mkdir pysatData | |
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'" | |
- name: Test PEP8 compliance | |
run: flake8 . --count --select=D,E,F,H,W --show-source --statistics | |
- name: Evaluate complexity | |
run: flake8 . --count --exit-zero --max-complexity=10 --statistics | |
- name: Test with pytest | |
run: pytest | |
- name: Publish results to coveralls | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
run: coveralls --rcfile=pyproject.toml --service=github | |
finish: | |
name: Finish Coverage Analysis | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pip install --upgrade coveralls | |
coveralls --service=github --finish |