Skip to content

Commit dabef68

Browse files
committed
added CI
readme updates
1 parent 1dabb9e commit dabef68

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

.github/workflows/CI.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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.7]
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@v2
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@v3
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 add-apt-repository ppa:ubuntu-toolchain-r/test
47+
sudo apt-get update
48+
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
49+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
50+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
51+
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
52+
# sudo apt-get install -y libblas-dev liblapack-dev
53+
54+
- name: Compile
55+
run: fpm build --profile release
56+
57+
- name: Run test
58+
run: fpm test
59+
60+
- name: Build documentation
61+
run: ford ./fortran-csv-module.md
62+
63+
- name: Deploy Documentation
64+
if: github.ref == 'refs/heads/master'
65+
uses: JamesIves/[email protected]
66+
with:
67+
branch: gh-pages # The branch the action should deploy to.
68+
folder: doc # The folder the action should deploy.

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
![fortran-csv-module](/media/logo.png)
22
============
33

4+
![Build Status](https://github.com/jacobwilliams/fortran-csv-module/actions/workflows/CI.yml/badge.svg)
5+
46
### Description
57

68
A modern Fortran library for reading and writing CSV (comma-separated value) files.
@@ -17,8 +19,9 @@ cd fortran-csv-module
1719
```
1820
#### Dependencies
1921
1. Git
20-
2. FoBis or [fpm](https://github.com/fortran-lang/fpm)
21-
3. Ford (optional)
22+
2. [FoBis](https://github.com/szaghi/FoBiS), [fpm](https://github.com/fortran-lang/fpm), or [CMake](https://cmake.org)
23+
3. [FORD](https://github.com/Fortran-FOSS-Programmers/ford) (optional)
24+
2225
#### Build with FoBis
2326
You can build using provided `build.sh`:
2427
```bash
@@ -39,7 +42,7 @@ fortran-csv-module = { git="https://github.com/jacobwilliams/fortran-csv-module.
3942

4043
### Examples
4144

42-
Everything is handled by an object-oriented `csv_file` class. Here is an example for writing a file:
45+
Everything is handled by an object-oriented `csv_file` class. Here is an example for writing a file:
4346

4447
```fortran
4548
program csv_write_test
@@ -82,7 +85,7 @@ x,y,z,t
8285

8386
Real, integer, logical, or character data can be added as scalars, vectors, and matrices.
8487

85-
When reading a CSV file, the data is stored internally in the class as allocatable character strings, which can be retrieved as real, integer, logical or character vectors as necessary. For example, to get the `x`, `y`, `z`, and `t` vectors from the previously-generated file:
88+
When reading a CSV file, the data is stored internally in the class as allocatable character strings, which can be retrieved as real, integer, logical or character vectors as necessary. For example, to get the `x`, `y`, `z`, and `t` vectors from the previously-generated file:
8689

8790
```fortran
8891
program csv_read_test

0 commit comments

Comments
 (0)