diff --git a/.github/workflows/docs-build-pr.yml b/.github/workflows/docs-build-pr.yml new file mode 100644 index 0000000..cc78124 --- /dev/null +++ b/.github/workflows/docs-build-pr.yml @@ -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 diff --git a/.github/workflows/docs-build-update.yml b/.github/workflows/docs-build-update.yml new file mode 100644 index 0000000..7d8e580 --- /dev/null +++ b/.github/workflows/docs-build-update.yml @@ -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:-}, from git ref <$GITHUB_REF>" + echo "CURBRANCH=${CURBRANCH}" >> "${GITHUB_ENV}" + echo "BUILD_TYPE=${BUILD_TYPE}" >> "${GITHUB_ENV}" + git config user.email "nxbench.bot@gmail.com" + 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 ' + + + + + + nxbench Documentation + + +

If you are not redirected, click here.

+ + ' > 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 diff --git a/.github/workflows/pypi-deploy.yml b/.github/workflows/pypi-deploy.yml index 71f1467..ca70217 100644 --- a/.github/workflows/pypi-deploy.yml +++ b/.github/workflows/pypi-deploy.yml @@ -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/gh-action-pypi-publish@v1.4.2 -# with: -# user: __token__ -# password: ${{ secrets.PYPI_API_TOKEN }} -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba6b436..755148e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 "nxbench.bot@gmail.com" -# git config --global user.name "nxbench bot" - -# - name: Bump Version -# run: | -# bump2version patch --allow-dirty - -# - name: Push Changes and Tags -# uses: ad-m/github-push-action@v0.6.0 -# 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 "nxbench.bot@gmail.com" + git config --global user.name "nxbench bot" + + - name: Bump Version + run: | + bump2version patch --allow-dirty + + - name: Push Changes and Tags + uses: ad-m/github-push-action@v0.6.0 + 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 diff --git a/README.md b/README.md index 23b604c..d95d1c4 100644 --- a/README.md +++ b/README.md @@ -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 + +

+ NxBench Logo +

**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. diff --git a/doc/_static/favicon.ico b/doc/_static/favicon.ico new file mode 100644 index 0000000..2915ca4 Binary files /dev/null and b/doc/_static/favicon.ico differ diff --git a/doc/_static/nxbench_logo.png b/doc/_static/nxbench_logo.png new file mode 100644 index 0000000..ecb197a Binary files /dev/null and b/doc/_static/nxbench_logo.png differ