Skip to content

Commit

Permalink
refactor: add minor elements to the repo - round (3) (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryMaciek authored Aug 1, 2023
1 parent c599edf commit e020604
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 51 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: dev

on: [push]

jobs:

ubuntu:
runs-on: ubuntu-22.04

steps:

- name: Checkout Repository
uses: actions/checkout@v3

- name: Display compiler version
run: g++ --version

- name: Install MPFR
run: |
sudo apt-get update -y
sudo apt-get install -y libmpfr-dev
- name: Make!
run: |
cd hypercomplex
make help
conda:
runs-on: ubuntu-22.04

steps:

- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Miniconda & Environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
auto-update-conda: true
activate-environment: hypercomplex-dev
environment-file: environment.yml
auto-activate-base: false

- name: Conda Info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: Make!
run: |
cd hypercomplex
make help
42 changes: 0 additions & 42 deletions .github/workflows/include.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/docs.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: docs
name: publish

on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:

gh-pages:

runs-on: ubuntu-22.04
env:
test-directory: .test/docs
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/install.yml → .github/workflows/user.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
name: Install
name: Include&Install

on: [push]

jobs:

Include:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, ubuntu-22.04]
env:
working-directory: .test/include

steps:

- name: Install MPFR
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
sudo apt-get install -y libmpfr-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew update
brew install mpfr
fi
- name: Checkout Repository
uses: actions/checkout@v2

- name: Copy Library Directory
working-directory: ${{env.working-directory}}
run: cp -r ../../hypercomplex hypercomplex

- name: Display compiler version
run: g++ --version

- name: Compile Test Program
working-directory: ${{env.working-directory}}
run: g++ --std=c++17 test.cpp -o test -lmpfr -lgmp

- name: Execute Test Program
working-directory: ${{env.working-directory}}
run: ./test

Install:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tasks:
command: |
parse_git_branch() { git branch --show-current ; }
export PS1="\e[1;37m(\$(parse_git_branch)) \e[0;33m\w \e[1;37m$\e[0m "
pre-commit install
echo "Ready to work!"
echo "Remember to switch to a feature branch before starting the development :)"
Expand Down
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:

- id: no-commit-to-branch
name: "[01/09] Forbid committing to `master` branch"
args: [--branch=master]
always_run: true

- id: check-merge-conflict
name: "[02/09] Check for merge conflict strings"
always_run: true

- id: check-case-conflict
name: "[03/09] Guard against case-insensitive filesystems"
always_run: true

- id: fix-byte-order-marker
name: "[04/09] Remove UTF-8 byte order marker (BOM)"
always_run: true

- id: check-added-large-files
name: "[05/09] Forbid commiting files bigger than 1MB"
args: [— maxkb=1024]
always_run: true

- id: trailing-whitespace
name: "[06/09] Check for trailing whitespaces"
args: [--markdown-linebreak-ext=md]
always_run: true

- id: end-of-file-fixer
name: "[07/09] Ensure 1 newline at the end of each file"
always_run: true

- id: mixed-line-ending
name: "[08/09] Correct mixed line endings"
always_run: true

- id: check-yaml
name: "[09/09] Check YAML files syntax"
files: \.ya?ml$
always_run: true
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/AngryMaciek/hypercomplex)
[![build](https://github.com/AngryMaciek/hypercomplex/workflows/Include/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3AInclude)
[![build](https://github.com/AngryMaciek/hypercomplex/workflows/Install/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3AInstall)
[![build](https://github.com/AngryMaciek/hypercomplex/workflows/Catch2/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3ACatch2)
[![pre-commit](https://img.shields.io/badge/pre--commit-+-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![user](https://github.com/AngryMaciek/hypercomplex/workflows/Include&Install/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3Auser)
[![catch2](https://github.com/AngryMaciek/hypercomplex/workflows/Catch2/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3ACatch2)
[![codecov](https://codecov.io/gh/AngryMaciek/hypercomplex/branch/master/graph/badge.svg?token=SSKOK4XR1M)](https://codecov.io/gh/AngryMaciek/hypercomplex)
[![Cpp17](https://img.shields.io/badge/C%2B%2B-17-blue)](https://en.wikipedia.org/wiki/C%2B%2B17)
[![build](https://github.com/AngryMaciek/hypercomplex/workflows/cpplint/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3Acpplint)
[![cpplint](https://github.com/AngryMaciek/hypercomplex/workflows/cpplint/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3Acpplint)
[![CodeFactor](https://www.codefactor.io/repository/github/angrymaciek/hypercomplex/badge)](https://www.codefactor.io/repository/github/angrymaciek/hypercomplex)
[![docs](https://github.com/AngryMaciek/hypercomplex/workflows/docs/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3Adocs)
[![publish](https://github.com/AngryMaciek/hypercomplex/workflows/publish/badge.svg?branch=master)](https://github.com/AngryMaciek/hypercomplex/actions?query=workflow%3Apublish)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05272/status.svg)](https://doi.org/10.21105/joss.05272)

<img src="img/logo.png" alt="drawing" height="30"/>
Expand Down
27 changes: 27 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###############################################################################
#
# Software to be installed in the environment
#
# AUTHOR: Maciek_Bak
# AFFILIATION: Department_of_Mathematics_City_University_of_London
# CONTACT: wsciekly.maciek@gmail.com
# CREATED: 01-08-2023
# LICENSE: Apache 2.0
#
###############################################################################
---

name: hypercomplex-dev

channels:
- conda-forge

dependencies:
- compilers=1.6.0
- cpplint=1.6.0
- doxygen=1.9.7
- make=4.3
- mpfr=4.2.0
- pre-commit=3.2.1

...

0 comments on commit e020604

Please sign in to comment.