Skip to content

Commit bf51ccf

Browse files
Merge pull request #4 from jacobwilliams/build-updates
build updates
2 parents 36bbf7d + 9835a20 commit bf51ccf

File tree

10 files changed

+153
-50
lines changed

10 files changed

+153
-50
lines changed

.github/workflows/CI.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
5+
Build:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest]
11+
gcc_v: [10] # Version of GFortran we want to use.
12+
python-version: [3.9]
13+
env:
14+
FC: gfortran-${{ matrix.gcc_v }}
15+
GCC_V: ${{ matrix.gcc_v }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3.0.2
20+
with:
21+
submodules: recursive
22+
23+
- name: Set up Python 3.x
24+
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Setup Graphviz
29+
uses: ts-graphviz/setup-graphviz@v1
30+
31+
- name: Setup Fortran Package Manager
32+
uses: fortran-lang/setup-fpm@v4
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Install Python dependencies
37+
if: contains( matrix.os, 'ubuntu')
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install matplotlib ford
41+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
42+
43+
- name: Install GFortran Linux
44+
if: contains( matrix.os, 'ubuntu')
45+
run: |
46+
sudo apt-get install lcov
47+
sudo update-alternatives \
48+
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc_v }} 100 \
49+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc_v }} \
50+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc_v }}
51+
52+
# - name: Compile
53+
# run: fpm build --profile release
54+
55+
- name: Run tests
56+
run: fpm test --profile debug --flag -coverage
57+
58+
- name: Create coverage report
59+
run: |
60+
mkdir -p ${{ env.COV_DIR }}
61+
lcov --capture --initial --base-directory . --directory build/gfortran_*/ --output-file ${{ env.COV_DIR }}/coverage.base
62+
lcov --capture --base-directory . --directory build/gfortran_*/ --output-file ${{ env.COV_DIR }}/coverage.capture
63+
lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.info
64+
env:
65+
COV_DIR: build/coverage
66+
67+
- name: Upload coverage report
68+
uses: codecov/codecov-action@v2
69+
with:
70+
files: build/coverage/coverage.info
71+
72+
- name: Build documentation
73+
run: ford ./fortran_function_parser.md
74+
75+
- name: Deploy Documentation
76+
if: github.ref == 'refs/heads/master'
77+
uses: JamesIves/github-pages-deploy-action@v4.3.3
78+
with:
79+
branch: gh-pages # The branch the action should deploy to.
80+
folder: doc # The folder the action should deploy.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ build
3232
doc
3333
lib
3434
bin
35+
36+
# misc
37+
.DS_Store

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Fortran Function Parser
22
https://github.com/jacobwilliams/fortran_function_parser
33

4-
Copyright (c) 2017, Jacob Williams
4+
Copyright (c) 2017-2022, Jacob Williams
55
All rights reserved.
66

77
Redistribution and use in source and binary forms, with or without modification,

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### Status
2+
3+
[![GitHub release](https://img.shields.io/github/release/jacobwilliams/fortran_function_parser.svg)](https://github.com/jacobwilliams/fortran_function_parser/releases/latest)
4+
[![Build Status](https://github.com/jacobwilliams/fortran_function_parser/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/fortran_function_parser/actions)
5+
[![codecov](https://codecov.io/gh/jacobwilliams/fortran_function_parser/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/fortran_function_parser)
6+
[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/fortran_function_parser)](https://github.com/jacobwilliams/fortran_function_parser/commits/master)
7+
18
### Description
29

310
This function parser module is intended for applications where a set of
@@ -6,6 +13,22 @@ then evaluated for a large number of variable values. This is done by
613
compiling the set of function strings into byte code, which is
714
interpreted efficiently for the various variable values.
815

16+
### Building
17+
18+
The library can be built with the [Fortran Package Manager](https://github.com/fortran-lang/fpm) using the provided `fpm.toml` file like so:
19+
20+
```bash
21+
fpm build --release
22+
```
23+
24+
To use `fortran_function_parser` within your fpm project, add the following to your `fpm.toml` file:
25+
26+
```yml
27+
[dependencies]
28+
fortran_function_parser = { git="https://github.com/jacobwilliams/fortran_function_parser.git" }
29+
```
30+
31+
932
### Basic usage
1033

1134
#### Module Import

build.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
comment:
2+
layout: header, changes, diff, sunburst
3+
coverage:
4+
ignore:
5+
- test
6+
- doc
7+
status:
8+
patch:
9+
default:
10+
target: 20%
11+
project:
12+
default:
13+
target: 60%
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {
8+
"files.trimTrailingWhitespace": true,
9+
"editor.insertSpaces": true,
10+
"editor.tabSize": 4,
11+
"editor.trimAutoWhitespace": true
12+
}
13+
}

fortran_function_parser.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
project: fortran_function_parser
22
project_dir: ./src
33
output_dir: ./doc
4+
media_dir: ./media
45
project_github: https://github.com/jacobwilliams/fortran_function_parser
56
summary: Modern Fortran Function Parser
67
author: Jacob Williams

fpm.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name = "fortran_function_parser"
2+
license = "BSD-3-Clause"
3+
author = "Jacob Williams"
4+
maintainer = "https://github.com/jacobwilliams"
5+
copyright = "Copyright (c) 2017-2022, Jacob Williams"
6+
description = "Modern Fortran Function Parser"
7+
homepage = "https://github.com/jacobwilliams/fortran_function_parser"
8+
keywords = ["parser"]
9+
10+
[library]
11+
source-dir = "src"
12+
13+
[install]
14+
library = true
15+
16+
[build]
17+
auto-executables = false
18+
auto-examples = false
19+
auto-tests = true
File renamed without changes.

0 commit comments

Comments
 (0)