Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI with actions #5

Merged
merged 4 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI
on: [push]


jobs:
tests_and_coverage:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
- {compiler: intel, version: '2024.1'}
- {compiler: intel, version: '2023.2'}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: false

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install Python
uses: actions/setup-python@v1 # 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@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ford numpy matplotlib gcovr numpy scipy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get install libnlopt-dev

- name: Run tests without coverage
if: ${{ env.FC != 'gfortran' }}
run: |
fpm test --profile release --flag "-g" --compiler ${{ env.FC }} --c-compiler gcc

- name: Run tests with coverage
if: ${{ env.FC == 'gfortran' }}
run: |
fpm test --profile release --flag "-g -coverage" --compiler ${{ env.FC }} --c-compiler gcc

- name: Coverage
run: gcovr --exclude "build" --jacoco coverage.xml
if: ${{ env.FC == 'gfortran' }}

- name: Upload coverage reports to Codecov
if: ${{ env.FC == 'gfortran' }}
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: fedebenelli/ForTimize
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Deploy Documentation

on: [push, pull_request, workflow_dispatch]

jobs:
documentation:
runs-on: ubuntu-22.04

env:
FC: gfortran
GCC_V: 12

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

- name: Install Dependencies Ubuntu
run: |
sudo apt-get update
sudo apt install -y gfortran-${GCC_V} python3-dev graphviz
sudo pip install ford markdown

- name: Build Developer Documentation
run: |
ford ford.md

- name: Upload Documentation
uses: actions/upload-artifact@v2
with:
name: documentation
path: doc/ford_site
if-no-files-found: error

- name: Broken Link Check
if: ${{ github.ref == 'refs/heads/main'}}
uses: technote-space/broken-link-checker-action@v1
with:
TARGET: file://${{ github.workspace }}/ford_site/index.html
RECURSIVE: true
ASSIGNEES: ${{ github.actor }}

- name: Deploy API Documentation
uses: JamesIves/github-pages-deploy-action@4.1.0
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: doc/ford_site
24 changes: 24 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
require_ci_to_pass: true
coverage:
precision: 2
range:
- 60.0
- 80.0
round: down
status:
changes: false
default_rules:
flag_coverage_not_uploaded_behavior: include
patch:
default:
target: 90.0
project:
default:
target: 90.0
github_checks:
annotations: true

ignore:
- build
- app
34 changes: 34 additions & 0 deletions ford.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
project: ForTimize
summary: Optimization Algorithms
project_github: https://github.com/fedebenelli/ForTimize
author: Federico Benelli
author_description: PhD candidate - Phase Equilibria Modelling
email: federico.benelli@mi.unc.edu.ar
github: https://github.com/fedebenelli
src_dir: src
exclude_dir: test doc src/adiff/hyperdual.f90 src/adiff/autodiff_api/tapenade
output_dir: doc/ford_site
preprocessor: gfortran -E
display: public
protected
private
source: false
proc_internals: true
sort: permission-alpha
docmark_alt: !>
docmark: !
predocmark_alt: *
print_creation_date: true
creation_date: %Y-%m-%d %H:%M %z
md_extensions: markdown.extensions.toc
markdown.extensions.smarty
graph: false
license: MPL
page_dir: doc/page
media_dir: doc/media
---

[TOC]

{!README.md!}
Loading