Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…vplanet into OutputOrder
  • Loading branch information
RoryBarnes committed Sep 12, 2024
2 parents 189ffee + d76bb0b commit 1d4d1e8
Show file tree
Hide file tree
Showing 19 changed files with 220 additions and 109 deletions.
157 changes: 125 additions & 32 deletions .github/workflows/pip-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,72 @@ on:

jobs:
build_wheels:
name: Build wheel
runs-on: ubuntu-latest
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: 3.9

- uses: ilammy/msvc-dev-cmd@v1
python-version: ${{ matrix.python-version }}

- name: Install cibuildwheel
- name: Install packages
run: |
python -m pip install cibuildwheel==2.12.1
python -m pip install -U pip
python -m pip install setuptools
python -m pip install cibuildwheel
- name: Build wheel
- name: Build wheel on Linux
if: runner.os == 'Linux'
run: |
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
python -m cibuildwheel --output-dir wheelhouse
else
echo "$RUNNER_OS not supported"
exit 1
fi
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp3?-*'
CIBW_SKIP: '*-manylinux_i686'
CIBW_SKIP: '*-manylinux_i686'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
shell: bash

- uses: actions/upload-artifact@v3
- 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:
path: ./wheelhouse/*.whl
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse/

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
name: Building source 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
with:
Expand All @@ -52,27 +80,92 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Install packages
run: |
python -m pip install -U pip
python -m pip install setuptools
- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v4
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: sdist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
- 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-*
path: dist

- 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
# if: (!github.event.release.prerelease) && github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet'
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}
4 changes: 2 additions & 2 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

jobs:
sanitizer:
name: Run address-sanitizer on Ubuntu
runs-on: ubuntu-latest
name: Run address-sanitizer on macOS
runs-on: macos-13
strategy:
fail-fast: false

Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
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'
Expand Down Expand Up @@ -46,32 +46,28 @@ jobs:
shell: bash -l {0}
run: |
make opt
pytest --tb=short
pytest --tb=short --junitxml=junit/test-results.xml
- name: Check test ouptut created
- name: Check test output created
id: check_test_file
uses: andstor/file-existence-action@v3
with:
files: "/home/runner/work/vplanet/vplanet/junit/test-results.xml"
files: "${{ github.workspace }}/junit/test-results.xml"
fail: true

- name: Generate coverage
id: coverage
if: steps.test.outcome == 'success' && steps.check_test_file.outcome == 'success'
run: make coverage

- name: Get unique id
uses: Tiryoh/gha-jobid-action@v1
id: jobs

- name: Publish unit test results
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9' }}
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: junit/test-*.xml

- name: CodeCov
if: ${{ matrix.os }} == ubuntu-22.04 && ${{ matrix.python-version }} == '3.9'
- 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 }}
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/tests-macos-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-12, macos-13]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
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
Expand All @@ -35,8 +35,11 @@ jobs:
if: steps.setup_python.outcome == 'success'
run: |
make opt
pytest --tb=short
pytest --tb=short --junitxml=junit/test-results.xml
- name: Get unique id
uses: Tiryoh/gha-jobid-action@v1
id: jobs
- 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
14 changes: 9 additions & 5 deletions .github/workflows/tests-macos-silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [macos-14]
python-version: ['3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -35,8 +35,12 @@ jobs:
if: steps.setup_python.outcome == 'success'
run: |
make opt
pytest --tb=short
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

- name: Get unique id
uses: Tiryoh/gha-jobid-action@v1
id: jobs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests/Vspace_Log/Log_Test/
*BP_CreateHDF5*
*BP_Extract*
*BP_Stats*
junit/

coverage.info
.coverage
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include VERSION
include src/*.c
include src/*.h
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ legacy:
@echo "=========================================================================================================="

debug:
-gcc -g -D DEBUG -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
-gcc -g -D DEBUG -Wunused-but-set-variable -Wunused-variable -Wfloat-equal -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"

debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
Expand All @@ -51,6 +51,9 @@ opt:
cpp:
g++ -o bin/vplanet src/*.c -lm -O3 -fopenmp -fpermissive -w -DGITVERSION=\"$(GITVERSION)\"

warnings:
clang -Weverything src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"

parallel:
gcc -o bin/vplanet src/*.c -lm -O3 -fopenmp -DGITVERSION=\"$(GITVERSION)\"

Expand All @@ -68,9 +71,12 @@ test:
-pytest --tb=short

coverage:
-mkdir -p gcov && cd gcov && gcc -coverage -o ../bin/vplanet ../src/*.c -lm
-python -m pytest --tb=short tests --junitxml=junit/test-results.xml
-lcov --capture --directory gcov --output-file .coverage && genhtml .coverage --output-directory gcov/html
-rm -f ./gcov/*.gcda ./gcov/*.gcno ./.coverage
-mkdir -p ./gcov
-cd gcov && gcc -coverage -o ./../bin/vplanet ./../src/*.c -lm
-python -m pytest --tb=short tests --junitxml=./junit/test-results.xml
-lcov --capture --directory ./gcov --output-file ./.coverage
-genhtml ./.coverage --output-directory ./gcov/html

docs:
-make -C docs html && echo 'Documentation available at `docs/.build/html/index.html`.'
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
</a>
<img src="https://github.com/VirtualPlanetaryLaboratory/vplanet/actions/workflows/pip-install.yml/badge.svg">
<br>
<img src="https://img.shields.io/badge/Unit%20Tests-19,130-darkblue.svg">
<img src="https://img.shields.io/badge/Unit%20Tests-19,599-darkblue.svg">
<img src="https://github.com/VirtualPlanetaryLaboratory/vplanet/actions/workflows/tests-linux.yml/badge.svg">
<img src="https://img.shields.io/badge/Ubuntu%2020-Python%203.6--3.11-7d93c7.svg">
<img src="https://img.shields.io/badge/Ubuntu%2022-Python%203.7--3.11-7d93c7.svg">
<img src="https://img.shields.io/badge/Ubuntu%2020-Python%203.6--3.12-7d93c7.svg">
<img src="https://img.shields.io/badge/Ubuntu%2022-Python%203.7--3.12-7d93c7.svg">
<a href="https://codecov.io/gh/VirtualPlanetaryLaboratory/vplanet">
<img src="https://codecov.io/gh/VirtualPlanetaryLaboratory/vplanet/branch/main/graph/badge.svg?token=3LFJQO1M6H">
</a>
<br>
<img src="https://github.com/VirtualPlanetaryLaboratory/vplanet/actions/workflows/tests-macos-intel.yml/badge.svg">
<img src="https://img.shields.io/badge/MacOS%2011--13-Python%203.6--3.11-7d93c7.svg">
<img src="https://img.shields.io/badge/MacOS%2012--13-Python%203.6--3.12-7d93c7.svg">
<img src="https://github.com/VirtualPlanetaryLaboratory/vplanet/actions/workflows/tests-macos-silicon.yml/badge.svg">
<img src="https://img.shields.io/badge/MacOS%2014-Python%203.10--3.11-7d93c7.svg">
<img src="https://img.shields.io/badge/MacOS%2014-Python%203.8--3.12-7d93c7.svg">
<br>
<img src="https://img.shields.io/badge/Test%20Sims-70-darkblue.svg">
<img src="https://github.com/VirtualPlanetaryLaboratory/vplanet/actions/workflows/memcheck.yml/badge.svg">
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.6
2.5.31
Loading

0 comments on commit 1d4d1e8

Please sign in to comment.