Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c95bf0c
ci: add GitHub Actions workflow for continuous integration
pageldev Jan 19, 2025
def5ff6
ci: update CI workflow to use Ninja generator and fix dependency inst…
pageldev Jan 19, 2025
0097dca
ci: enhance CI workflow with separate configure, build, test, and ins…
pageldev Jan 19, 2025
986f98f
ci: set default shell to bash with strict error handling in CI workflow
pageldev Jan 19, 2025
e13c339
ci: add Windows build job to CI workflow for Windows 2022
pageldev Jan 19, 2025
26e8cf1
ci: comment out Linux build job for now and update Windows shell to m…
pageldev Jan 19, 2025
b0633ea
try fix msys shell
pageldev Jan 19, 2025
26555ba
ci: update Windows shell path to use bash executable
pageldev Jan 19, 2025
943fee4
ci: remove Ninja generator from CMake configuration
pageldev Jan 19, 2025
c18db21
ci: update C++ compiler flags for MSVC to use warning level 3
pageldev Jan 19, 2025
837222e
ci: remove unnecessary _USE_MATH_DEFINES definition from Math.hpp and…
pageldev Jan 19, 2025
f849d56
ci: add testing and installation steps to CI workflow for windows-2022
pageldev Jan 19, 2025
0cc22e1
ci: remove sudo from cmake install command in CI workflow
pageldev Jan 19, 2025
6aaf34c
ci: restore and update CI workflow for Linux build on ubuntu-22.04, d…
pageldev Jan 19, 2025
2c649b9
ci: streamline CI workflow by consolidating cmake commands and adding…
pageldev Jan 19, 2025
0b80726
ci: remove wrong --config option from test command in CI workflow
pageldev Jan 19, 2025
1239e91
ci: enhance format-files script with error handling and check mode
pageldev Jan 19, 2025
076ee6e
ci: add format check step to CI workflow for consistency
pageldev Jan 19, 2025
25cea93
ci: remove format check step from CI workflow
pageldev Jan 19, 2025
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
41 changes: 41 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: [push, pull_request]

jobs:
build-linux:
name: ubuntu-22.04-release
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -e -o pipefail {0}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: check format
run: ./format-files.sh check
- name: configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: build
run: cmake --build build
- name: test
run: ctest --test-dir build --output-on-failure
- name: install
run: sudo cmake --install build
build-windows:
name: windows-2022-release
runs-on: windows-2022
defaults:
run:
shell: C:\msys64\usr\bin\bash.exe {0}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: configure
run: cmake -S . -B build -G "Visual Studio 17 2022"
- name: build
run: cmake --build build --config Release
- name: test
run: ctest --test-dir build --output-on-failure
- name: install
run: cmake --install build --config Release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

if(MSVC)
set(CMAKE_CXX_FLAGS "/EHsc /Wall")
set(CMAKE_CXX_FLAGS "/EHsc /W3")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
add_compile_definitions(_USE_MATH_DEFINES)
Expand Down
12 changes: 11 additions & 1 deletion format-files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

set -euo pipefail

MODE="${1:-default}"

PROJ_ROOT=$(dirname $0)

if ! type -p clang-format >/dev/null; then
Expand All @@ -21,7 +25,13 @@ else
exit 1
fi

EXTRA_FLAGS=""
if [[ "$MODE" == "check" ]]; then
echo "check mode enabled, not formatting files, only checking"
EXTRA_FLAGS="--dry-run --Werror"
fi

find "${PROJ_ROOT}" -type f \
\( -name "*.cpp" -o -name "*.c" -o -name "*.hpp" -o -name "*.h" \) \
-not -path "${PROJ_ROOT}/build/*" \
-print -exec clang-format --style=file -i '{}' \;
-print0 | xargs -0 clang-format $EXTRA_FLAGS --style=file --verbose -i
1 change: 0 additions & 1 deletion include/Math.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <cmath>
Expand Down
3 changes: 1 addition & 2 deletions src/Geometries/Spiral/odrSpiral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
*/

/* ====== INCLUSIONS ====== */
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>

namespace odr
{
Expand Down