diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ec2182..db04f0d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,55 +17,57 @@ jobs: include: - runs-on: ubuntu-latest config: -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 - conda: environment.yaml - prop: tests & examples - runs-on: macos-latest config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1 - conda: environment.yaml - prop: tests - runs-on: windows-latest config: -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - conda: environment.yaml - prop: tests defaults: run: - shell: bash -l {0} + shell: bash -e -l {0} - name: ${{ matrix.runs-on }} • x64 ${{ matrix.args }} + name: ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} steps: - - name: Basic GitHub action setup + - name: Clone this library uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Set conda environment - uses: mamba-org/provision-with-micromamba@main + - name: Create conda environment + uses: mamba-org/setup-micromamba@main with: - environment-file: ${{ matrix.conda }} + environment-file: environment.yaml environment-name: myenv + init-shell: bash + cache-downloads: true + create-args: >- + ${{ runner.os == 'Windows' && 'ninja' || '' }} + ${{ runner.os == 'Windows' && 'clang_win-64' || '' }} - - name: Install clang - if: runner.os == 'Windows' - run: micromamba install -c conda-forge clang_win-64 ninja - - - name: Set dummy version - run: echo "SETUPTOOLS_SCM_PRETEND_VERSION=0.0" >> $GITHUB_ENV + - name: Export version of this library + run: | + LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV - name: Configure using CMake run: cmake -Bbuild ${{ matrix.config }} - - name: Build C++ ${{ matrix.prop }} + - name: Build C++ working-directory: build run: cmake --build . - - name: Run C++ ${{ matrix.prop }} + - name: Run C++ working-directory: build run: ctest --output-on-failure - name: Build and install Python module - run: python setup.py install --build-type Release -vv + run: python -m pip install . -v --no-build-isolation + + - name: Run Python tests + run: pytest - name: Run Python tests if: runner.os == 'macOS' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d050591f..926cd3d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: hooks: - id: cpp_comment_format - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.4 + rev: v17.0.5 hooks: - id: clang-format args: [-i] diff --git a/include/GooseEYE/GooseEYE.h b/include/GooseEYE/GooseEYE.h index 09ab0c13..b7c7e356 100644 --- a/include/GooseEYE/GooseEYE.h +++ b/include/GooseEYE/GooseEYE.h @@ -199,7 +199,9 @@ class Clusters { */ template Clusters(const T& f, bool periodic = true) - : Clusters(f, kernel::nearest(f.dimension()), periodic){}; + : Clusters(f, kernel::nearest(f.dimension()), periodic) + { + } /** * Constructor.