Skip to content

Commit

Permalink
Merge pull request #3 from jacobwilliams/ci
Browse files Browse the repository at this point in the history
updated CI
  • Loading branch information
jacobwilliams committed May 15, 2022
2 parents 28c596e + 8650080 commit 144420f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 24 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
matrix:
os: [ubuntu-latest]
gcc_v: [10] # Version of GFortran we want to use.
python-version: [3.7]
python-version: [3.9]
env:
FC: gfortran-${{ matrix.gcc_v }}
GCC_V: ${{ matrix.gcc_v }}

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

Expand All @@ -37,32 +37,44 @@ jobs:
if: contains( matrix.os, 'ubuntu')
run: |
python -m pip install --upgrade pip
pip install numpy matplotlib ford
pip install matplotlib ford
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install GFortran Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
# sudo apt-get install -y libblas-dev liblapack-dev
sudo apt-get install lcov
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: Compile
# run: fpm build --profile release

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

- name: Create coverage report
run: |
mkdir -p ${{ env.COV_DIR }}
lcov --capture --initial --base-directory . --directory build/gfortran_*/ --output-file ${{ env.COV_DIR }}/coverage.base
lcov --capture --base-directory . --directory build/gfortran_*/ --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@v2
with:
files: build/coverage/coverage.info

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

- name: Deploy Documentation
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@4.1.0
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: doc # The folder the action should deploy.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

Derivative free 1D function minimizer in modern Fortran

![Build Status](https://github.com/jacobwilliams/fmin/actions/workflows/CI.yml/badge.svg)
### Status

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

### Compiling

Expand Down
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
comment:
layout: header, changes, diff, sunburst
coverage:
ignore:
- test
- doc
status:
patch:
default:
target: 20%
project:
default:
target: 60%
11 changes: 3 additions & 8 deletions fpm.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "fmin"
author = "Jacob Williams"
copyright = "Copyright (c) 2021, Jacob Williams"
copyright = "Copyright (c) 2021-2022, Jacob Williams"
license = "BSD-3"
description = "Derivative free 1D function minimizer in modern Fortran"
homepage = "https://github.com/jacobwilliams/fmin"
Expand All @@ -9,16 +9,11 @@ keywords = ["minimization"]
[build]
auto-executables = false
auto-examples = false
auto-tests = false
auto-tests = true
link = ["lapack", "blas"]

[library]
source-dir = "src"

[install]
library = true

[[test]]
name = "test"
source-dir = "tests"
main = "test.f90"
library = true
File renamed without changes.

0 comments on commit 144420f

Please sign in to comment.