diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index acee381a..31a1c73c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,35 +5,33 @@ on: branches: [main] jobs: - tests: + docs: name: "Build docs" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python id: setup_python - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: - activate-environment: vplanet - environment-file: environment.yml - python-version: 3.9 + python-version: '3.11' + cache: 'pip' + cache-dependency-path: setup.py - - name: Install - id: install - if: steps.setup_python.outcome == 'success' - shell: bash -l {0} + - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install -y doxygen - sudo apt-get install -y doxygen-doc + sudo apt-get install -y doxygen doxygen-doc + + - name: Install Python dependencies + run: | python -m pip install -U pip python -m pip install -e . + python -m pip install sphinx sphinx-rtd-theme breathe sphinxcontrib-bibtex - name: Build id: build - if: steps.install.outcome == 'success' - shell: bash -l {0} run: | cd docs make html @@ -42,7 +40,6 @@ jobs: - name: Publish uses: JamesIves/github-pages-deploy-action@v4 - # NOTE: Triggered only when the PR is *merged* (event_name == 'push') if: steps.build.outcome == 'success' && github.event_name == 'push' with: branch: gh-pages diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 0b916793..3e763c10 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -5,45 +5,38 @@ on: types: [published] jobs: - tests: - name: '${{ matrix.python-version }}' + examples: + name: 'Examples on py${{ matrix.python-version }}' runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install Latex - id: install_latex - shell: bash -l {0} + - name: Install LaTeX run: | sudo apt-get update - sudo apt-get install cm-super - sudo apt-get install texlive-fonts-recommended texlive-fonts-extra - sudo apt-get install dvipng + sudo apt-get install -y cm-super texlive-fonts-recommended texlive-fonts-extra dvipng - name: Set up Python - id: setup_python - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: - activate-environment: vplanet - environment-file: environment.yml python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: setup.py - - name: Install - id: install - if: steps.setup_python.outcome == 'success' - shell: bash -l {0} + - name: Install dependencies run: | python -m pip install -U pip python -m pip install -e . - - name: Run Examples - if: steps.install.outcome == 'success' - shell: bash -l {0} + - name: Build vplanet + run: make opt + + - name: Run examples run: python docs/run_examples.py diff --git a/.github/workflows/floatingpoint.yml b/.github/workflows/floatingpoint.yml index 381fc36b..a62a5a0c 100644 --- a/.github/workflows/floatingpoint.yml +++ b/.github/workflows/floatingpoint.yml @@ -13,20 +13,23 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Python - id: setup_python - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: - activate-environment: vplanet - environment-file: environment.yml - python-version: 3.9 + python-version: '3.11' + cache: 'pip' + cache-dependency-path: setup.py - - name: Run - shell: bash -l {0} + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -e . + + - name: Run floating point check run: | cd tests/ python floatingpoint.py diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index 165cde4f..055d55b6 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -12,29 +12,25 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Python - id: setup_python - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: - activate-environment: vplanet - environment-file: environment.yml - python-version: 3.8 + python-version: '3.11' + cache: 'pip' + cache-dependency-path: setup.py - - name: Install valgrind - id: install - if: steps.setup_python.outcome == 'success' - shell: bash -l {0} + - name: Install dependencies run: | sudo apt-get update - sudo apt-get install valgrind + sudo apt-get install -y valgrind + python -m pip install -U pip + python -m pip install -e . - name: Run valgrind test - if: steps.install.outcome == 'success' - shell: bash -l {0} run: | cd tests/ python valgrind.py diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index 27c88725..75902e20 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -1,78 +1,23 @@ name: pip-install + on: release: - types: [published] + types: + - published jobs: - build_wheels: - name: Building wheel for ${{ matrix.os }}:Python-${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - exclude: - - os: ubuntu-22.04 - python-version: '3.6' - - os: macos-14 - python-version: '3.6' - - os: macos-14 - python-version: '3.7' - fail-fast: false - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - id: setup_python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install packages - run: | - python -m pip install -U pip - python -m pip install setuptools - python -m pip install cibuildwheel - - - name: Build wheel on Linux - if: runner.os == 'Linux' - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BUILD: 'cp3?-*' - CIBW_SKIP: '*-manylinux_i686' - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - - - name: Build wheel on macOS - if: runner.os == 'macOS' - run: | - python -m cibuildwheel --output-dir wheelhouse - - - name: Upload wheel artifact - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.os }}-${{ matrix.python-version }} - path: ./wheelhouse/ - - build_sdist: - name: Building source for ${{ matrix.os }}:Python-${{ matrix.python-version }} + build: + name: 'py${{ matrix.python }} on ${{ matrix.os }}' runs-on: ${{ matrix.os }} strategy: - matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - exclude: - - os: ubuntu-22.04 - python-version: '3.6' - - os: macos-14 - python-version: '3.6' - - os: macos-14 - python-version: '3.7' fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, macos-26] + python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: true fetch-depth: 0 @@ -80,92 +25,43 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python }} + allow-prereleases: true - - name: Install packages + - name: Build run: | - python -m pip install -U pip - python -m pip install setuptools + python -m pip install -U pip build twine setuptools setuptools_scm wheel + python -m build - - name: Build sdist - run: python setup.py sdist + - name: Test the sdist + run: | + python -m venv venv-sdist + venv-sdist/bin/python -m pip install dist/vplanet*.tar.gz + venv-sdist/bin/python -c "import vplanet; print(vplanet.__version__)" + + - name: Test the wheel + run: | + python -m venv venv-wheel + venv-wheel/bin/python -m pip install dist/vplanet*.whl + venv-wheel/bin/python -c "import vplanet; print(vplanet.__version__)" - - name: Upload sdist artifact - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: - name: sdist-${{ matrix.os }}-${{ matrix.python-version }} - path: dist/ + name: dist-${{ matrix.os }}-${{ matrix.python }} + path: dist/* upload_pypi: - needs: [build_wheels, build_sdist] - runs-on: ubuntu-22.04 + needs: [build] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet' + permissions: + id-token: write steps: - - uses: actions/download-artifact@v4 - with: - name: wheel-ubuntu-20.04-3.6.whl - path: wheelhouse - - - uses: actions/download-artifact@v4 - with: - name: wheel-ubuntu-22.04-* - path: wheelhouse - - - uses: actions/download-artifact@v4 - with: - name: wheel-macos-12-* - path: wheelhouse - - - uses: actions/download-artifact@v4 - with: - name: wheel-macos-13-* - path: wheelhouse - - - uses: actions/download-artifact@v4 - with: - name: wheel-macos-14-* - path: wheelhouse - - - uses: actions/download-artifact@v4 - with: - name: sdist-ubuntu-20.04-* - path: dist - - - uses: actions/download-artifact@v4 - with: - name: sdist-ubuntu-22.04-* - path: dist - - - uses: actions/download-artifact@v4 - with: - name: sdist-macos-12-* - path: dist - - - uses: actions/download-artifact@v4 - with: - name: sdist-macos-13-* - path: dist - - - uses: actions/download-artifact@v4 - with: - name: sdist-macos-14-* + - uses: actions/download-artifact@v4 + with: + pattern: dist-* path: dist + merge-multiple: true - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install twine - - - name: Upload to PyPI - if: github.repository == 'VirtualPlanetaryLaboratory/vplanet' - run: python -m twine upload dist/* wheelhouse/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.pypi_password }} - - # Only push to PyPI if we're on the public repo! - # - uses: pypa/gh-action-pypi-publish@release/v1 - # if: (!github.event.release.prerelease) && github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet' - # with: - # user: __token__ - # password: ${{ secrets.pypi_password }} + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index aab048fc..b8d45dc0 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -8,27 +8,28 @@ on: jobs: sanitizer: name: Run address-sanitizer on macOS - runs-on: macos-13 + runs-on: macos-15 strategy: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Python - id: setup_python - uses: conda-incubator/setup-miniconda@v3 + uses: actions/setup-python@v5 with: - activate-environment: vplanet - environment-file: environment.yml - python-version: 3.9 + python-version: '3.11' + cache: 'pip' + cache-dependency-path: setup.py + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -e . - name: Run sanitizer - if: steps.setup_python.outcome == 'success' - shell: bash -l {0} run: | - make sanitize cd tests/ python sanitizer.py diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml deleted file mode 100644 index 9ea95a81..00000000 --- a/.github/workflows/tests-linux.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: tests-linux - -on: - pull_request: - branches: [main] - workflow_dispatch: - -jobs: - tests: - name: '${{ matrix.os }}:python-${{ matrix.python-version }}' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04, ubuntu-22.04] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - exclude: - - os: ubuntu-22.04 - python-version: '3.6' - fail-fast: false - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - id: setup_python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install - id: install - if: steps.setup_python.outcome == 'success' - shell: bash -l {0} - run: | - sudo apt-get update - python -m pip install -U pip - python -m pip install -e . - pip install pytest pytest-cov - sudo apt install lcov - - - name: Run tests - id: test - if: steps.install.outcome == 'success' - shell: bash -l {0} - run: | - make opt - pytest --tb=short --junitxml=junit/test-results.xml - - - name: Check test output created - id: check_test_file - uses: andstor/file-existence-action@v3 - with: - files: "${{ github.workspace }}/junit/test-results.xml" - fail: true - - - name: Publish unit test results - if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' }} - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - files: junit/test-*.xml - - - name: Generate coverage - id: coverage - if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' && steps.test.outcome == 'success' && steps.check_test_file.outcome == 'success' }} - run: make coverage - - - name: Upload to CodeCov - if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' }} - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: ./.coverage diff --git a/.github/workflows/tests-macos-intel.yml b/.github/workflows/tests-macos-intel.yml deleted file mode 100644 index cbf2313d..00000000 --- a/.github/workflows/tests-macos-intel.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: tests-macos-intel -on: - pull_request: - branches: [main] - workflow_dispatch: - -jobs: - tests: - name: '${{ matrix.os }}:python-${{ matrix.python-version }}' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-12, macos-13] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - id: setup_python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - if: steps.setup_python.outcome == 'success' - run: | - python -m pip install -U pip - python -m pip install -e . - python -m pip install pytest pytest-cov - - - name: Run tests - if: steps.setup_python.outcome == 'success' - run: | - make opt - pytest --tb=short --junitxml=junit/test-results.xml - - - name: Check test ouptut created - id: check_test_file - uses: andstor/file-existence-action@v3 - with: - files: "${{ github.workspace }}/junit/test-results.xml" - fail: true diff --git a/.github/workflows/tests-macos-silicon.yml b/.github/workflows/tests-macos-silicon.yml deleted file mode 100644 index 7ce3c060..00000000 --- a/.github/workflows/tests-macos-silicon.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: tests-macos-silicon -on: - pull_request: - branches: [main] - workflow_dispatch: - -jobs: - tests: - name: '${{ matrix.os }}:python-${{ matrix.python-version }}' - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Xcode v15.4 - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.4' - - - name: Set up Python - id: setup_python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - if: steps.setup_python.outcome == 'success' - run: | - python -m pip install -U pip - python -m pip install -e . - python -m pip install pytest pytest-cov - - - name: Run tests - if: steps.setup_python.outcome == 'success' - run: | - make opt - pytest --tb=short --junitxml=junit/test-results.xml - - - name: Check test ouptut created - id: check_test_file - uses: andstor/file-existence-action@v3 - with: - files: "${{ github.workspace }}/junit/test-results.xml" - fail: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..1be30645 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,70 @@ +name: tests + +on: + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + tests: + name: 'py${{ matrix.python-version }} on ${{ matrix.os }}' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, macos-26] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + id: setup_python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: setup.py + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e . + python -m pip install pytest pytest-cov pytest-timeout + + - name: Install lcov (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y lcov + + - name: Build vplanet + run: make opt + + - name: Run tests + timeout-minutes: 20 + run: | + python -m pytest tests/ --tb=short -v --timeout=300 --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml + + - name: Generate coverage + if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' + run: make coverage + + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./.coverage + flags: ${{ matrix.os }}-py${{ matrix.python-version }} + name: ${{ matrix.os }}-py${{ matrix.python-version }} + fail_ci_if_error: false + + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() && runner.os == 'Linux' + with: + files: junit/test-*.xml + check_name: Test Results (py${{ matrix.python-version }} on ${{ matrix.os }})