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
11 changes: 11 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Benchmark

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

permissions:
Expand Down Expand Up @@ -124,6 +132,9 @@ jobs:
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@v4

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Docs

on:
push:
branches: [main]
paths:
- "docs/**"
- "README.md"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
workflow_dispatch:

permissions:
contents: write

concurrency:
group: docs-pages
cancel-in-progress: true

jobs:
build-and-deploy:
name: Build and deploy MkDocs
runs-on: ubuntu-latest
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

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

- name: Install Python dependencies
run: uv sync --frozen

- name: Build site
run: task docs

- 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(docs): publish run ${{ github.run_id }}"
159 changes: 85 additions & 74 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,99 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
push:
branches: [main]
paths:
- "include/**"
- "tests/**"
- "CMakeLists.txt"
- "Taskfile.yml"
- ".github/workflows/tests.yml"
pull_request:
branches: [main]
paths:
- "include/**"
- "tests/**"
- "CMakeLists.txt"
- ".github/workflows/tests.yml"
workflow_dispatch:

permissions:
contents: read
contents: read

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

jobs:
linux:
name: Linux (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
build_dir: build-gcc
cc: gcc
cxx: g++
- compiler: clang
build_dir: build-clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build ccache
- name: Install Task
uses: go-task/setup-task@v1
with:
version: 3.x
- name: Cache build dir (${{ matrix.compiler }})
uses: actions/cache@v4
with:
path: ${{ matrix.build_dir }}
key: ${{ runner.os }}-${{ matrix.compiler }}-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-build-
- name: Run tests (${{ matrix.compiler }})
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: task test:${{ matrix.compiler }}
linux:
name: Linux (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
build_dir: build-gcc
cc: gcc
cxx: g++
- compiler: clang
build_dir: build-clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build ccache
- name: Install Task
uses: go-task/setup-task@v1
with:
version: 3.x
- name: Cache build dir (${{ matrix.compiler }})
uses: actions/cache@v4
with:
path: ${{ matrix.build_dir }}
key: ${{ runner.os }}-${{ matrix.compiler }}-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-build-
- name: Run tests (${{ matrix.compiler }})
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: task test:${{ matrix.compiler }}

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@v4
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@v4

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

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

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

- name: Run tests (${{ matrix.compiler }})
run: task test:${{ matrix.compiler }}
- name: Run tests (${{ matrix.compiler }})
run: task test:${{ matrix.compiler }}
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
"editor.formatOnType": true,
"editor.formatOnPaste": false,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.tabSize": 2
},
"[cpp]": {
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.tabSize": 4,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.env.windows": {
"PSExecutionPolicyPreference": "RemoteSigned"
Expand Down
6 changes: 6 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ tasks:
- cp README.md docs/index.md
- uv run mkdocs build

serve:
desc: Serve documentation locally
cmds:
- cp README.md docs/index.md
- uv run mkdocs serve

# ============================
# Aggregates
# ============================
Expand Down
1 change: 1 addition & 0 deletions docs/googlead6cd4877a2cd852.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google-site-verification: googlead6cd4877a2cd852.html
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
site_name: libcpprime Documentation
site_url: https://rac75116.github.io/libcpprime/
theme:
name: material
logo: assets/favicon.png
Expand All @@ -16,6 +17,7 @@ theme:
accent: indigo
repo_url: https://github.com/Rac75116/libcpprime
repo_name: Rac75116/libcpprime
copyright: "Copyright © 2025 Rac75116"
nav:
- libcpprime: index.md
- "GitHub Repository": https://github.com/Rac75116/libcpprime
Expand Down