-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Tests for PROTEUS | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
if: github.event.pull_request.draft == false | ||
name: Run Coverage and Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'false' | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/cache@v3 | ||
id: cache-virtualenv | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
run: | | ||
python -m pip install -e .[develop] | ||
- name: Test with pytest | ||
run: | | ||
coverage run -m pytest | ||
- name: Report coverage | ||
run: | | ||
coverage json | ||
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | ||
echo "total=$TOTAL" >> $GITHUB_ENV | ||
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY | ||
echo $'\n```' >> $GITHUB_STEP_SUMMARY | ||
coverage report >> $GITHUB_STEP_SUMMARY | ||
echo $'\n```' >> $GITHUB_STEP_SUMMARY | ||
# - name: Make coverage badge | ||
# if: ${{ github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }} | ||
# uses: schneegans/[email protected] | ||
# with: | ||
# auth: ${{ secrets.GIST_TOKEN }} | ||
# gistID: b4ee7dab92e20644bcb3a5ad09f71165 | ||
# filename: covbadge.svg | ||
# label: Coverage | ||
# message: ${{ env.total }}% | ||
# minColorRange: 50 | ||
# maxColorRange: 90 | ||
# valColorRange: ${{ env.total }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
[![Tests for CALLIOPE](https://github.com/FormingWorlds/CALLIOPE/actions/workflows/tests.yaml/badge.svg)](https://github.com/FormingWorlds/CALLIOPE/actions/workflows/tests.yaml) | ||
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | ||
|
||
# CALLIOPE | ||
Volatile delivery and planetary accretion model designed for integration into PROTEUS. | ||
Numerical model for the equilibrium outgassing of volatiles from a magma ocean. | ||
|
||
Named after the [Greek muse of eloquence and epic poetry](https://en.wikipedia.org/wiki/Calliope). | ||
Prounounced: *kal-IGH-uh-pee*. | ||
|
||
## Installation | ||
|
||
Simply run `pip install -e .` in this folder and `calliope` will be added to your Python environment. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import annotations | ||
|
||
from calliope import __version__ | ||
|
||
|
||
def test_version(): | ||
assert __version__ |