diff --git a/.github/workflows/include.yml b/.github/workflows/include.yml deleted file mode 100644 index 77081a9..0000000 --- a/.github/workflows/include.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Include - -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 diff --git a/.github/workflows/install.yml b/.github/workflows/user.yml similarity index 54% rename from .github/workflows/install.yml rename to .github/workflows/user.yml index 46d3213..38c8992 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/user.yml @@ -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: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f35a3d3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/README.md b/README.md index aacc49c..d062f1c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/AngryMaciek/hypercomplex) [![pre-commit](https://img.shields.io/badge/pre--commit-+-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) -[![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) +[![user](https://github.com/AngryMaciek/hypercomplex/workflows/user/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) [![DOI](https://joss.theoj.org/papers/10.21105/joss.05272/status.svg)](https://doi.org/10.21105/joss.05272)