Skip to content

Commit b45f230

Browse files
committed
added CI and doc deploy
1 parent 3256811 commit b45f230

File tree

6 files changed

+135
-3
lines changed

6 files changed

+135
-3
lines changed

.github/workflows/CI.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
5+
Build:
6+
runs-on: ${{ matrix.os }}
7+
permissions:
8+
contents: write
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest]
13+
gcc_v: [14] # Version of GFortran we want to use.
14+
python-version: [3.12]
15+
env:
16+
FC: gfortran-${{ matrix.gcc_v }}
17+
GCC_V: ${{ matrix.gcc_v }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
with:
23+
submodules: recursive
24+
25+
- name: Install Python
26+
uses: actions/setup-python@v5.4.0 # Use pip to install latest CMake, & FORD/Jin2For, etc.
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Setup Graphviz
31+
uses: ts-graphviz/setup-graphviz@v1
32+
33+
- name: Setup Fortran Package Manager
34+
uses: fortran-lang/setup-fpm@v7
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Install Python dependencies
39+
if: contains( matrix.os, 'ubuntu')
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install ford numpy matplotlib
43+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
44+
45+
- name: Install GFortran Linux
46+
if: contains( matrix.os, 'ubuntu')
47+
run: |
48+
sudo apt-get install lcov
49+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
50+
sudo apt-get update
51+
sudo apt-get install -y gcc-${{ matrix.gcc_v }} gfortran-${{ matrix.gcc_v }}
52+
sudo update-alternatives \
53+
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc_v }} 100 \
54+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc_v }} \
55+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc_v }}
56+
sudo apt-get install libblas-dev liblapack-dev
57+
58+
- name: Run tests
59+
run: fpm run halo_solver --profile debug --compiler gfortran --flag -fopenmp -- examples/example.json
60+
# run: fpm run --profile debug --compiler gfortran --flag -fopenmp -- examples/example.json
61+
62+
- name: Build documentation
63+
run: ford ./ford.md
64+
65+
- name: Deploy Documentation
66+
if: github.ref == 'refs/heads/master'
67+
uses: JamesIves/github-pages-deploy-action@v4.7.3
68+
with:
69+
branch: gh-pages # The branch the action should deploy to.
70+
folder: doc # The folder the action should deploy.
71+
single-commit: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
/build
3737
/toolkit
3838
*.tar.Z
39+
/doc

LICENSE.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2025, Jacob Williams
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice, this
11+
list of conditions and the following disclaimer in the documentation and/or
12+
other materials provided with the distribution.
13+
14+
* The names of its contributors may not be used to endorse or promote products
15+
derived from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Description
2+
3+
A Fortran library to interpolate the MOON_PA reference frame without using SPICE.
4+
5+
[![Language](https://img.shields.io/badge/-Fortran-734f96?logo=fortran&logoColor=white)](https://github.com/topics/fortran)
6+
[![GitHub release](https://img.shields.io/github/release/jacobwilliams/moonframe.svg)](https://github.com/jacobwilliams/moonframe/releases/latest)
7+
[![Build Status](https://github.com/jacobwilliams/moonframe/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/moonframe/actions)
8+
[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/moonframe)](https://github.com/jacobwilliams/moonframe/commits/master)
19

210
### Usage
311

@@ -19,3 +27,8 @@ The use the library, SPICELIB is not required. It can be imported like any norma
1927
[dependencies]
2028
moonframe = { git="https://github.com/jacobwilliams/moonframe.git" }
2129
```
30+
31+
### Documentation
32+
33+
34+
The latest API documentation for the `master` branch can be found [here](https://jacobwilliams.github.io/moonframe/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford).

ford.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
project: moonframe
2+
src_dir: ./src
3+
output_dir: ./doc
4+
media_dir: ./media
5+
project_github: https://github.com/jacobwilliams/moonframe
6+
summary: A Fortran library to interpolate the MOON_PA reference frame without using SPICE.
7+
author: Jacob Williams
8+
github: https://github.com/jacobwilliams
9+
predocmark_alt: >
10+
predocmark: <
11+
docmark_alt:
12+
docmark: !
13+
display: public
14+
private
15+
protected
16+
source: true
17+
graph: true
18+
extra_mods: iso_fortran_env:https://gcc.gnu.org/onlinedocs/gfortran/ISO_005fFORTRAN_005fENV.html
19+
bspline_module:https://jacobwilliams.github.io/bspline-fortran/
20+
csv_module:https://jacobwilliams.github.io/csv-fortran/
21+
22+
{!README.md!}

src/moon_frame_module.F90

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
module moon_frame_module
66
use bspline_module
77
use iso_fortran_env
8+
use csv_module
89

910
implicit none
1011

@@ -42,10 +43,8 @@ module moon_frame_module
4243
subroutine initialize_moon_frame_interpolater(me, filename, k, extrapolate)
4344
!! initialize the moon frame interpolater with the given csv file.
4445

45-
use csv_module
46-
4746
class(moon_frame_interpolater),intent(inout) :: me
48-
character(len=*),intent(in) :: filename !! csv file with roll, pitch, and yaw angles vs ephemeris time. (see [[generate_csv_file]])
47+
character(len=*),intent(in) :: filename !! csv file with roll, pitch, and yaw angles vs ephemeris time. (see `generate_csv_file`)
4948
integer,intent(in),optional :: k !! spline order (`kx` in bspline_module). If not given, use the default quartic order.
5049
logical,intent(in),optional :: extrapolate !! if true, extrapolate the spline outside the range of the data. Default is false.
5150

0 commit comments

Comments
 (0)