Skip to content

Commit

Permalink
docstring cleanup
Browse files Browse the repository at this point in the history
added CI
  • Loading branch information
jacobwilliams committed Jan 25, 2024
1 parent 3baea1b commit ff27b28
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 181 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI
on: [push]
jobs:

Build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
gcc_v: [10] # Version of GFortran we want to use.
python-version: [3.9]
env:
FC: gfortran-${{ matrix.gcc_v }}
GCC_V: ${{ matrix.gcc_v }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Python
uses: actions/setup-python@v4 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: ${{ matrix.python-version }}

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

- name: Setup Fortran Package Manager
uses: fortran-lang/setup-fpm@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Python dependencies
if: contains( matrix.os, 'ubuntu')
run: |
python -m pip install --upgrade pip
pip install ford numpy matplotlib
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install GFortran Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt-get install lcov
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc_v }} gfortran-${{ matrix.gcc_v }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc_v }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc_v }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc_v }}
# - name: Compile
# run: fpm build --profile release

- name: Run tests
run: fpm test --profile debug --flag -coverage

- name: Create coverage report
run: |
mkdir -p ${{ env.COV_DIR }}
mv ./build/gfortran_*/*/* ${{ env.COV_DIR }}
lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base
lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture
lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.info
env:
COV_DIR: build/coverage

- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: build/coverage/coverage.info

- name: Build documentation
run: ford ./ford.md

- name: Deploy Documentation
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: doc # The folder the action should deploy.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
LSMR: Sparse Equations and Least Squares

### Status
[![GitHub release](https://img.shields.io/github/release/jacobwilliams/LSMR.svg)](https://github.com/jacobwilliams/LSMR/releases/latest)
[![CI Status](https://github.com/jacobwilliams/LSMR/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/LSMR/actions)
[![codecov](https://codecov.io/gh/jacobwilliams/LSMR/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/LSMR)
[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/LSMR)](https://github.com/jacobwilliams/LSMR/commits/master)

### Readme

README for lsmrf90
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ coverage:
status:
patch:
default:
target: 70%
target: 20%
project:
default:
target: 60%
target: 20%
2 changes: 1 addition & 1 deletion ford.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ src_dir: ./src
output_dir: ./doc
media_dir: ./media
project_github: https://github.com/jacobwilliams/LSMR
summary: LSMR
summary: LSMR: Sparse Equations and Least Squares
author: Jacob Williams
github: https://github.com/jacobwilliams
predocmark_alt: >
Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LSMR"
version = "0.1.0"
license = "license"
license = "BSD"
author = "Jacob Williams"
copyright = "Copyright 2024, Jacob Williams"

Expand Down
Loading

0 comments on commit ff27b28

Please sign in to comment.