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
8 changes: 4 additions & 4 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Diagnostics:
UnusedIncludes: Strict
MissingIncludes: Strict
UnusedIncludes: Strict
MissingIncludes: Strict

InlayHints:
ParameterNames: false
DeducedTypes: false
ParameterNames: false
DeducedTypes: false
17 changes: 0 additions & 17 deletions .devcontainer/Dockerfile

This file was deleted.

18 changes: 0 additions & 18 deletions .devcontainer/devcontainer.json

This file was deleted.

297 changes: 144 additions & 153 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,162 +1,153 @@
name: Benchmark

on:
push:
branches: [main]
paths:
- "include/**"
- "benchmarks/**"
- "CMakeLists.txt"
- "Taskfile.yml"
- ".github/workflows/bench.yml"
workflow_dispatch:
push:
branches: [main]
paths:
- "include/**"
- "benchmarks/**"
- "CMakeLists.txt"
- "mise.toml"
- ".github/workflows/bench.yml"
workflow_dispatch:

permissions:
contents: write
contents: read

concurrency:
group: benchmark-pages
cancel-in-progress: false
group: benchmark-pages
cancel-in-progress: false

jobs:
linux:
name: Linux (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
build_dir: build-gcc
- compiler: clang
build_dir: build-clang
steps:
- uses: actions/checkout@v7

- name: Install build dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build ccache clang

- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x

- name: Setup uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock

- name: Cache deps
uses: actions/cache@v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-

- name: Run benchmark via task
run: task bench-heavy:${{ matrix.compiler }}

- name: Upload benchmark artifacts
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp

windows:
name: Windows (${{ matrix.compiler }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: msvc
build_dir: build-msvc
- compiler: clang-cl
build_dir: build-clang-cl
steps:
- uses: actions/checkout@v7

- name: Install LLVM + Ninja (clang-cl)
if: matrix.compiler == 'clang-cl'
shell: pwsh
run: |
choco install llvm ninja -y --no-progress

- name: Install Task
uses: go-task/setup-task@v2
with:
version: 3.x

- name: Setup uv
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock

- name: Cache deps
uses: actions/cache@v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-

- name: Run benchmark via task
run: task bench-heavy:${{ matrix.compiler }}

- name: Upload benchmark artifacts
uses: actions/upload-artifact@v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp

publish-pages:
name: Publish benchmark results to GitHub Pages
runs-on: ubuntu-latest
needs: [linux, windows]
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v7

- name: Download benchmark artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
pattern: benchmark-*

- name: Prepare Pages content
run: >-
python3 scripts/publish_benchmarks_to_pages.py
--artifacts-dir artifacts
--site-dir site
--repo "${{ github.repository }}"
--run-id "${{ github.run_id }}"

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: site
keep_files: true
commit_message: "chore(bench): publish run ${{ github.run_id }}"
linux:
name: Linux (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
build_dir: build-gcc
- compiler: clang
build_dir: build-clang
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Install build dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y clang

- name: Setup mise tools
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4

- name: Cache deps
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-

- name: Run benchmark via mise
run: mise run bench-heavy:${{ matrix.compiler }}

- name: Upload benchmark artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp

windows:
name: Windows (${{ matrix.compiler }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: msvc
build_dir: build-msvc
- compiler: clang-cl
build_dir: build-clang-cl
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Install LLVM (clang-cl)
if: matrix.compiler == 'clang-cl'
shell: pwsh
run: |
choco install llvm -y --no-progress

- name: Setup mise tools
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4

- name: Cache deps
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ${{ matrix.build_dir }}/_deps
key: ${{ runner.os }}-${{ matrix.compiler }}-deps-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-deps-

- name: Run benchmark via mise
run: mise run bench-heavy:${{ matrix.compiler }}

- name: Upload benchmark artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: benchmark-${{ runner.os }}-${{ matrix.compiler }}
if-no-files-found: warn
path: |
benchmarks/bench_summary.md
benchmarks/bench_IsPrime.webp
benchmarks/bench_IsPrimeNoTable.webp
benchmarks/bench_summary.webp

publish-pages:
name: Publish benchmark results to GitHub Pages
runs-on: ubuntu-latest
needs: [linux, windows]
permissions:
contents: write
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Setup mise tools
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4

- name: Download benchmark artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts
pattern: benchmark-*

- name: Prepare Pages content
run: >-
mise x -- uv run scripts/publish_benchmarks_to_pages.py
--artifacts-dir artifacts
--site-dir site
--repo "${{ github.repository }}"
--run-id "${{ github.run_id }}"

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: site
keep_files: true
commit_message: "chore(bench): publish run ${{ github.run_id }}"
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Setup mise tools
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4
- name: Cache dprint plugins
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ~/.cache/dprint
key: ${{ runner.os }}-dprint-${{ hashFiles('dprint.json', 'mise.toml') }}
restore-keys: |
${{ runner.os }}-dprint-
- name: Run check
run: mise run check
Loading
Loading