diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d60f0707 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..5381d5ef --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,77 @@ +name: CI +on: + push: + branches: + - main + tags: ['*'] + paths-ignore: + - 'LICENSE.md' + - 'README.md' + - '.github/workflows/CompatHelper.yml' + - '.github/workflows/SpellCheck.yml' + - 'docs/**' + pull_request: + paths-ignore: + - 'LICENSE.md' + - 'README.md' + - '.github/workflows/CompatHelper.yml' + - '.github/workflows/SpellCheck.yml' + - 'docs/**' + workflow_dispatch: + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test: + if: "!contains(github.event.head_commit.message, 'skip ci')" + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.10' + os: + - ubuntu-latest + - macos-latest + - windows-latest + arch: + - x64 + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)' + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + with: + directories: src + - uses: codecov/codecov-action@v4 + with: + files: lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}-${{ github.run_id }} + parallel: true + path-to-lcov: ./lcov.info + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 00000000..14b7e859 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,16 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: Pkg.add("CompatHelper") + run: julia -e 'using Pkg; Pkg.add("CompatHelper")' + - name: CompatHelper.main() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "test"])' diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 00000000..71eea717 --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request, workflow_dispatch] + +jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@v1.23.6 diff --git a/Project.toml b/Project.toml index a7593674..9f230c96 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,6 @@ FastGaussQuadrature = "1" HCubature = "1.5" julia = "1.6" LinearAlgebra = "1" -Meshes = "0.36 - 0.47" +Meshes = "0.47, 0.48" QuadGK = "2" Unitful = "1" diff --git a/README.md b/README.md index 68dcab13..c4496041 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # MeshIntegrals.jl +[![Build Status](https://github.com/mikeingold/MeshIntegrals.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/mikeingold/MeshIntegrals.jl/actions/workflows/CI.yml?query=branch%3Amain) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) +[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT) + This package implements methods for numerically-computing integrals over geometric polytopes from [**Meshes.jl**](https://github.com/JuliaGeometry/Meshes.jl) using the following `::IntegrationAlgorithms`: - Gauss-Legendre quadrature rules from [**FastGaussQuadrature.jl**](https://github.com/JuliaApproximation/FastGaussQuadrature.jl): `GaussLegendre(n)` @@ -29,15 +33,15 @@ unit_circle_bz = BezierCurve( # A Real-valued function f(x, y, z) = abs(x + y) -f(p) = f(p.coords...) +f(p) = f(to(p)...) integral(f, unit_circle_xy, GaussKronrod()) - # 56.500 μs (1819 allocations: 100.95 KiB) - # ans == 5.656854249502878 + # 0.000170 seconds (5.00 k allocations: 213.531 KiB) + # ans == 5.656854249525293 m^2 integral(f, unit_circle_bz, GaussKronrod()) - # 9.638 ms (18830 allocations: 78.40 MiB) - # ans = 5.551055333711397 + # 0.017122 seconds (18.93 k allocations: 78.402 MiB) + # ans = 5.551055333711397 m^2 ``` # Support Matrix