diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4049f90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: CI + +on: + push: + branches: + - 'main' + - '*.*' + tags: + - 'v*' + pull_request: + workflow_dispatch: + +jobs: + core: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + toxdeps: tox-pypi-filter + envs: | + - linux: py312 + libraries: + apt: + - libboost-all-dev + coverage: 'codecov' + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + tests: + needs: [core] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + toxdeps: tox-pypi-filter + envs: | + - macos: py311 + libraries: + brew: + - boost + - windows: py310 + libraries: + choco: + - boost-msvc-14.3 + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + docs: + needs: [tests] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + toxdeps: tox-pypi-filter + envs: | + - linux: build_docs-gallery + python-version: '3.12' + libraries: + apt: + - libboost-all-dev + + + publish: + # Build wheels when pushing to any branch except main + # publish.yml will only publish if tagged ^v.* + if: | + ( + github.event_name != 'pull_request' && ( + github.ref_name != 'main' || + github.event_name == 'workflow_dispatch' + ) + ) || ( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Run publish') + ) + needs: [tests] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@main + with: + test_extras: 'dev' + test_command: 'pytest -p no:warnings --doctest-rst --pyargs ebtelplusplus' + targets: | + - linux + - macos + - windows + secrets: + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index cd2d3c5..0000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Deploy Docs - -on: - push: - branches: [main] - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install Python dependencies - run: | - pip install -r requirements/requirements-docs.txt - - name: Install boost - run: | - sudo apt-get update - sudo apt-get install libboost-all-dev - - name: Compile ebtel++ - run: | - scons - - name: Build Docs - run: | - cd docs - make - cd .. - - name: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: gh-pages - folder: docs/site \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 9a922f4..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - name: Run tests - command: pytest - - name: Build docs - command: cd docs && make && cd .. - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install Python dependencies - run: | - pip install -r requirements/requirements-all.txt - - name: Install boost - run: | - sudo apt-get update - sudo apt-get install libboost-all-dev - - name: Compile ebtel++ - run: | - scons - - run: | - ${{ matrix.command }} diff --git a/docs/conf.py b/docs/conf.py index 1317f5d..38ee497 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -77,6 +77,43 @@ # a list of builtin themes. html_theme = "pydata_sphinx_theme" +html_theme_options = { + "use_edit_page_button": True, + "icon_links": [ + { + "name": "GitHub", + "url": "https://github.com/rice-solar-physics/ebtelplusplus", + "icon": "fa-brands fa-github", + }, + { + "name": "PyPI", + "url": "https://pypi.org/project/ebtelplusplus/", + "icon": "fa-brands fa-python", + }, + ], +} +html_context = { + "github_user": "rice-solar-physics", + "github_repo": "ebtelplusplus", + "github_version": "main", + "doc_path": "docs", +} +# Sidebar removal +html_sidebars = { + "bibliography*": [], + "development*": [], +} +# Render inheritance diagrams in SVG +graphviz_output_format = "svg" +graphviz_dot_args = [ + '-Nfontsize=10', + '-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif', + '-Efontsize=10', + '-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif', + '-Gfontsize=10', + '-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif' +] + # -- Other options ---------------------------------------------------------- bibtex_bibfiles = ['references.bib'] diff --git a/docs/development.rst b/docs/development.rst index 3900da7..b7b6f36 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -40,12 +40,12 @@ To verify that you have a working installation, you can run the test suite, .. code:: shell - pytest ebtelplusplus + $ pytest ebtelplusplus You are now ready to start contributing to or modifying ``ebtelplusplus``. Note that if you are modifying any of the simulation code, that is contained in ``ebtelplusplus/extern`` and is implemented in C++. After each change, you will need to recompile using the above installation command. -For more information about proposing new changes back to the main repository, see `this section of the SunPy newcomer's guide `. +For more information about proposing new changes back to the main repository, see `this section of the SunPy newcomer's guide `__. .. _ebtelplusplus: https://github.com/rice-solar-physics/ebtelPlusPlus