Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 33 additions & 24 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to delete the old caches it created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -26,46 +30,51 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
with:
cache-registries: "true"
cache-compiled: "true"
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
# the threaded factorizations need several threads to be exercised
JULIA_NUM_THREADS: 4
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
docs:
name: Documentation
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
actions: write # needed to allow julia-actions/cache to delete the old caches it created
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- name: Configure doc environment
run: |
julia --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/cache@v3
# instantiates `docs/` and runs `docs/make.jl`, whose `makedocs` also runs the doctests
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using HMatrices
DocMeta.setdocmeta!(HMatrices, :DocTestSetup, :(using HMatrices); recursive=true)
doctest(HMatrices)'
runic:
name: Runic formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- uses: julia-actions/cache@v3
# checks every Julia file of the repository
- uses: fredrikekre/runic-action@v1
with:
version: '1'
38 changes: 34 additions & 4 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,44 @@ on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: Add the General registry via Git
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: Install CompatHelper
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: Run CompatHelper
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# an SSH key, so that the pull requests CompatHelper opens trigger CI (those opened
# with GITHUB_TOKEN do not); the Documenter deploy key serves
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
21 changes: 0 additions & 21 deletions .github/workflows/FormatCheck.yml

This file was deleted.

87 changes: 18 additions & 69 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,31 @@
name: Run benchmarks

# Compare the benchmarks of `benchmark/benchmarks.jl` (taken from the pull request) between
# the default branch and the pull request, on a GitHub-hosted runner, and post the ratios
# as a comment. The absolute times of these shared machines are noisy, but both revisions
# run in the same job, so their ratios are meaningful.
on:
pull_request:
types: [labeled, opened, reopened, synchronize]

permissions:
pull-requests: write

env:
PACKAGE_NAME: HMatrices
concurrency:
group: benchmark-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
Benchmark:
runs-on: self-hosted
# run if PR has `run benchmark` label
if: contains(github.event.pull_request.labels.*.name, 'run benchmark')
runs-on: ubuntu-latest
# only for pull requests labeled `run benchmark`, from branches of this repository
if: >-
contains(github.event.pull_request.labels.*.name, 'run benchmark') &&
(github.event.action != 'labeled' || github.event.label.name == 'run benchmark') &&
github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
with:
version: 1
- uses: julia-actions/cache@v2

- name: Build AirspeedVelocity
env:
JULIA_NUM_THREADS: 8
OPENBLAS_NUM_THREADS: 1
run: |
# Lightweight build step, as sometimes the runner runs out of memory:
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.add(;url="https://github.com/MilesCranmer/AirspeedVelocity.jl.git")'
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.build("AirspeedVelocity")'

- name: Add ~/.julia/bin to PATH
run: |
echo "$HOME/.julia/bin" >> $GITHUB_PATH

- name: Run benchmarks
run: |
echo $PATH
ls -l ~/.julia/bin
mkdir results
benchpkg ${{env.PACKAGE_NAME}} --rev="${{github.event.pull_request.base.sha}},${{github.event.pull_request.head.sha}}" --url=${{github.event.repository.clone_url}} --bench-on="${{github.event.pull_request.head.sha}}" --output-dir=results/ --tune

- name: Create plots from benchmarks
run: |
mkdir -p plots
benchpkgplot ${{env.PACKAGE_NAME}} --rev="${{github.event.pull_request.base.sha}},${{github.event.pull_request.head.sha}}" --npart=10 --format=pdf --input-dir=results/ --output-dir=plots/

- name: Upload plot as artifact
uses: actions/upload-artifact@v4
with:
name: plots
path: plots

- name: Create markdown table from benchmarks
run: |
benchpkgtable ${{env.PACKAGE_NAME}} --rev="${{github.event.pull_request.base.sha}},${{github.event.pull_request.head.sha}}" --input-dir=results/ --ratio > table.md
echo '### Benchmark Results' > body.md
echo '' >> body.md
echo '' >> body.md
cat table.md >> body.md
echo '' >> body.md
echo '' >> body.md
echo '### Benchmark Plots' >> body.md
echo 'A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.' >> body.md
echo 'Go to "Actions"->"Run benchmarks"->[the most recent run]->"Artifacts" (at the bottom).' >> body.md

- name: Find Comment
uses: peter-evans/find-comment@v3
id: fcbenchmark
with:
issue-number: ${{github.event.pull_request.number}}
comment-author: "github-actions[bot]"
body-includes: Benchmark Results

- name: Comment on PR
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{steps.fcbenchmark.outputs.comment-id}}
issue-number: ${{github.event.pull_request.number}}
body-path: body.md
edit-mode: replace
julia-version: "1"
bench-on: ${{ github.event.pull_request.head.sha }}
exeflags: "--threads=4"
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name = "HMatrices"
uuid = "8646bddf-ab1c-4fa7-9c51-ba187d647618"
version = "0.2.13"
version = "0.3"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -13,6 +14,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
LinearAlgebra = "1"
Printf = "1"
Random = "1"
RecipesBase = "1.1"
SparseArrays = "1"
StaticArrays = "1.2"
Expand Down
1 change: 0 additions & 1 deletion benchmark/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
HMatrices = "8646bddf-ab1c-4fa7-9c51-ba187d647618"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Loading
Loading