Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs #5

Merged
merged 2 commits into from
Dec 5, 2024
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
41 changes: 41 additions & 0 deletions .github/workflows/docs-build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Docs

on:
push:
branches:
- 'feature/**'

jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U build pip
pip install .[doc]

- name: Build docs
run: |
make clean_doc
python -m build
make doc_html
92 changes: 92 additions & 0 deletions .github/workflows/docs-build-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build & Update Docs

on:
push:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Determine branch/tag and set git author
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
CURBRANCH=${GITHUB_REF##*/}
BUILD_TYPE="tag"
elif [[ "$GITHUB_REF" == refs/heads/* ]]; then
CURBRANCH=${GITHUB_REF##*/}
BUILD_TYPE="branch"
else
CURBRANCH="unknown"
BUILD_TYPE="unknown"
fi
CURBRANCH=$( echo "$CURBRANCH" | sed 's+/+_+g' )
echo "Building branch/tag ${CURBRANCH:-<unknown>}, from git ref <$GITHUB_REF>"
echo "CURBRANCH=${CURBRANCH}" >> "${GITHUB_ENV}"
echo "BUILD_TYPE=${BUILD_TYPE}" >> "${GITHUB_ENV}"
git config user.email "[email protected]"
git config user.name "nxbench bot"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]

- name: Build docs
run: |
make clean_doc
make doc_html

- name: Create Redirect
run: |
echo '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=main/index.html">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nxbench Documentation</title>
</head>
<body>
<p>If you are not redirected, <a href="main/index.html">click here</a>.</p>
</body>
</html>' > index.html

- name: Deploy to gh-pages
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: |
git stash --include-untracked

git fetch origin gh-pages
git checkout gh-pages || git checkout --orphan gh-pages

if [[ "${BUILD_TYPE}" == "branch" && "${CURBRANCH}" == "main" ]]; then
git rm -rf main/ || true
elif [[ "${BUILD_TYPE}" == "tag" ]]; then
git rm -rf "${CURBRANCH}/" || true
fi

if [[ "${BUILD_TYPE}" == "branch" && "${CURBRANCH}" == "main" ]]; then
mkdir -p main/
cp -r doc/build/html/* main/
elif [[ "${BUILD_TYPE}" == "tag" ]]; then
mkdir -p "${CURBRANCH}/"
cp -r doc/build/html/* "${CURBRANCH}/"
fi

git checkout gh-pages -- index.html || true

git add .
git commit -m "doc: Update documentation for ${CURBRANCH}" || true
git push origin gh-pages
84 changes: 42 additions & 42 deletions .github/workflows/pypi-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# name: Build and Deploy to PyPI
name: Build and Deploy to PyPI

# on:
# push:
# tags:
# - 'v*.*.*'
# repository_dispatch:
# types: [deploy-pypi]
on:
push:
tags:
- 'v*.*.*'
repository_dispatch:
types: [deploy-pypi]

# jobs:
# build-and-deploy:
# name: Build and Deploy to PyPI
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
jobs:
build-and-deploy:
name: Build and Deploy to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

# - name: Cache pip
# uses: actions/cache@v4
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
# restore-keys: |
# ${{ runner.os }}-pip-
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip setuptools wheel twine
# pip install -U build
- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install -U build

# - name: Build Package
# run: |
# python -m build --sdist --wheel
- name: Build Package
run: |
python -m build --sdist --wheel

# - name: Publish to PyPI
# uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
96 changes: 48 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# name: Release

# on:
# push:
# branches:
# - main

# jobs:
# bump-version-and-tag:
# name: Bump Version and Create Tag
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'

# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip
# pip install bump2version

# - name: Configure Git user
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "nxbench bot"

# - name: Bump Version
# run: |
# bump2version patch --allow-dirty

# - name: Push Changes and Tags
# uses: ad-m/[email protected]
# with:
# github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# branch: main
# tags: true

# - name: Trigger PyPI Deployment
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# event-type: deploy-pypi
name: Release

on:
push:
branches:
- main

jobs:
bump-version-and-tag:
name: Bump Version and Create Tag
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install bump2version

- name: Configure Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "nxbench bot"

- name: Bump Version
run: |
bump2version patch --allow-dirty

- name: Push Changes and Tags
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
branch: main
tags: true

- name: Trigger PyPI Deployment
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
event-type: deploy-pypi
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# nxbench
[![Python](https://img.shields.io/pypi/pyversions/nxbench.svg)](https://badge.fury.io/py/nxbench)
[![PyPI](https://badge.fury.io/py/nxbench.svg)](https://badge.fury.io/py/nxbench)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# NxBench

<p align="center">
<img src="doc/_static/nxbench_logo.png" alt="NxBench Logo" width="150"/>
</p>

**nxbench** is a comprehensive benchmarking suite designed to facilitate comparative profiling of graph analytic algorithms across NetworkX and compatible backends. Built with an emphasis on extensibility and detailed performance analysis, nxbench aims to enable developers and researchers to optimize their graph analysis workflows efficiently and reproducibly.

Expand Down
1 change: 1 addition & 0 deletions doc/_static/css/badge_only.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added doc/_static/css/fonts/Roboto-Slab-Bold.woff
Binary file not shown.
Binary file added doc/_static/css/fonts/Roboto-Slab-Bold.woff2
Binary file not shown.
Binary file added doc/_static/css/fonts/Roboto-Slab-Regular.woff
Binary file not shown.
Binary file added doc/_static/css/fonts/Roboto-Slab-Regular.woff2
Binary file not shown.
Binary file added doc/_static/css/fonts/fontawesome-webfont.eot
Binary file not shown.
Loading
Loading