Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ name: docs

on:
push:
branches: [master, main]
#pull_request: TODO: Enable me
# branches:[master, main]
branches: [main]

jobs:
tests:
name: "Build docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5

- name: Set up Python
id: setup_python
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: vplanet
environment-file: environment.yml
Expand All @@ -41,7 +39,7 @@ jobs:
touch _build/html/.nojekyll

- name: Publish
uses: JamesIves/github-pages-deploy-action@4.1.2
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:
Expand Down
83 changes: 40 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,71 @@ name: tests

on:
push:
branches: [master, main]
branches: [main]
pull_request:
branches: [master, main]
branches: [main]

jobs:
tests:
name: 'Run tests on py${{ matrix.python-version }}'
runs-on: ubuntu-latest
name: 'py${{ matrix.python-version }} on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.6'
- python-version: '3.7'
- python-version: '3.8'
- python-version: '3.9'
# - python-version: '3.10'
os: [ubuntu-22.04]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Python
id: setup_python
uses: conda-incubator/setup-miniconda@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
activate-environment: vplanet
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install vplanet
id: install
if: steps.setup_python.outcome == 'success'
shell: bash -l {0}
- name: Install VPLanet
run: |
python -m pip install --upgrade pip
python -m pip install vplanet

- name: Install vspace
id: tools
if: steps.install.outcome == 'success'
shell: bash -l {0}
run: |
python -m pip install -e .

- name: Run tests
if: steps.install.outcome == 'success'
shell: bash -l {0}
run: python -m pytest -v tests --junitxml=junit/test-results.xml --cov=vspace/ --cov-report=xml
- name: Install test dependencies
run: |
python -m pip install pytest pytest-cov pytest-timeout

- name: Get unique id
id: unique-id
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
- name: Run diagnostic test
timeout-minutes: 3
run: |
export JOB_ID=`echo $STRATEGY_CONTEXT | md5sum`
echo "::set-output name=id::$JOB_ID"
# First run a simple unit test to verify pytest works
echo "Running single unit test as diagnostic..."
python -m pytest tests/Vspace_Explicit/test_vspace_explicit.py -v -s

- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: junit/test-*.xml
- name: Run tests
timeout-minutes: 20
run: |
# Run all tests with verbose output, capture disabled to see subprocess output, and per-test timeout
python -m pytest tests/ -v -s --timeout=300 --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=vspace --cov-report=xml --cov-report=term

- name: CodeCov
uses: codecov/codecov-action@v2.1.0
- name: Upload coverage to Codecov
# Only upload from one runner to avoid redundant API calls
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
#shell: bash -l {0}
#run: |
# bash <(curl -s https://codecov.io/bash)
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 }})
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,21 @@ dmypy.json
.pyre/


# Test folders
# Test folders - output directories from test runs
tests/Vspace_Explicit/Explict_Test/
tests/Vspace_Linear/Linear_Test/
tests/Vspace_Log/Log_Test/
tests/Vspace_PreDefPrior_npy/Npy_PredefPrior_Test/
tests/Vspace_PreDefPrior_txt/Txt_PredefPrior_Test/
tests/Random/*_Test*/
tests/Errors/*_Test*/
tests/ErrorHandling/*_Test*/
tests/GridMode/*_Test*/
tests/FileOps/*_Test*/
tests/Integration/*_Test*/

# Backup files
*.backup

# SCM version
vspace/vspace_version.py
Expand Down
Loading