Skip to content
Closed
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
25 changes: 25 additions & 0 deletions .github/actions/compile-library/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Build Wheel'
description: 'Build wheel'

inputs:
os:
description: "operating system"
required: true

runs:
using: "composite"
steps:
- name: Build and test C++ Components (Linux)
if: inputs.os == 'Linux'
shell: bash
run: |
CXX=$(which g++-14) ./scripts/build.sh
sudo ./scripts/test.sh

- name: Build and test C++ Components (Windows)
if: inputs.os == 'Windows'
shell: pwsh
run: |
cmake --preset windows-x64
cmake --build --preset windows-x64 --config Debug
cmake --install build_windows_x64 --config Debug
12 changes: 12 additions & 0 deletions .github/actions/harden-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: checkout
description: checkout

runs:
using: "composite"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24 changes: 24 additions & 0 deletions .github/actions/publish-doc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Build Documentation'
description: 'Build Documentation'

runs:
using: 'composite'
steps:
- name: Install dependencies
shell: bash
run: |
uv pip install --system -r pyproject.toml
uv pip install --system -r docs/requirements_docs.txt

- name: Build documentation
shell: bash
run: cd docs && make html

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: './docs/build/html'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
42 changes: 42 additions & 0 deletions .github/actions/publish-pypi/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: publish-pypi
description: publish-pypi

inputs:
os:
description: "operating system"
required: true

runs:
using: "composite"
steps:
- name: Install Python Packages
if: inputs.os == 'Linux'
shell: bash
run: |
uv pip install --system --upgrade build cibuildwheel
rm -rf dist

- name: Build Sdist
if: inputs.os == 'Linux'
shell: bash
run: |
python -m build --sdist

- name: Build Wheel (Linux)
if: inputs.os == 'Linux'
shell: bash
run: python -m cibuildwheel --output-dir dist
env:
CIBW_BEFORE_ALL_LINUX: |
echo "Building deps"
yum install -y sudo;
sudo ./scripts/download_install_libraries.sh capnp compile
sudo ./scripts/download_install_libraries.sh capnp install
CIBW_BUILD: "*manylinux_x86_64"
CIBW_SKIP: "pp*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@db8f07d3871a0a180efa06b95d467625c19d5d5f # release/v1
with:
packages_dir: ./dist/
34 changes: 34 additions & 0 deletions .github/actions/run-linter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Run Linter'
description: 'Run Linter'

inputs:
os:
description: "operating system"
required: true

runs:
using: 'composite'
steps:
- name: Install Python Packages (Linux)
if: inputs.os == 'Linux'
shell: bash
run: |
uv pip install --system flake8 pyproject-flake8 mypy
uv pip install --system -r pyproject.toml --all-extras

- name: Install Python Packages (Windows)
if: inputs.os == 'Windows'
shell: bash
run: |
uv pip install --system flake8 pyproject-flake8 mypy
uv pip install --system -r pyproject.toml --extra graphblas --extra gui

- name: Lint With flake8
shell: bash
run: |
pflake8 .

- name: Lint With MyPy
shell: bash
run: |
mypy --install-types --non-interactive .
36 changes: 36 additions & 0 deletions .github/actions/run-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Run Tests With Wheel Installed'
description: 'Run Unit Tests And Examples With Wheel Installed'

inputs:
os:
description: "operating system"
required: true

runs:
using: "composite"
steps:
# TODO: build wheel first, then run the test
- name: Run Unittests
shell: bash
run: |
python -m unittest discover -v tests

- name: Run Examples
shell: bash
run: |
uv pip install --system -r examples/applications/requirements_applications.txt
for example in "./examples"/*.py; do
echo "Running $example"
PYTHONPATH=. python $example
done
for example in "./examples/applications"/*.py; do
if python -c 'import sys; sys.exit(not sys.version_info <= (3, 10))'; then
if [ "$example" = "./examples/applications/yfinance_historical_price.py" ]; then
echo "Skipping $example"
continue;
fi
fi

echo "Running $example"
PYTHONPATH=. python $example
done
64 changes: 64 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Setup Environment'
description: 'Setup Environment'

inputs:
os:
description: "operating system"
required: true

runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.8"

- name: Update System (Linux)
shell: bash
if: inputs.os == 'Linux'
run: |
sudo apt update -y
sudo apt install -y build-essential tzdata cmake clang curl pkg-config g++-14
sudo chmod 755 ./scripts/download_install_libraries.sh
sudo chmod 755 ./scripts/build.sh

- name: Install Python Packages
shell: bash
run: |
pip install uv
uv pip install --system --upgrade pip
uv pip install --system 'scapy==2.*'

- name: Cache Library Install
if: inputs.os == 'Linux'
id: cache-library
uses: actions/cache@v4
with:
path: |
capnproto-*
key: ${{ inputs.os }}-${{ hashFiles('scripts/download_install_libraries.*') }}

- name: Download/Compile Libraries (Linux)
shell: bash
if: (inputs.os == 'Linux') && (steps.cache-library.outputs.cache-hit != 'true')
run: |
sudo ./scripts/download_install_libraries.sh capnp compile

- name: Download/Compile Libraries (Windows)
shell: pwsh
if: (inputs.os == 'Windows') && (steps.cache-boost-windows.outputs.cache-hit != 'true')
run: |
./scripts/download_install_libraries.ps1 capnp compile

- name: Install Libraries (Linux)
shell: bash
if: inputs.os == 'Linux'
run: |
sudo ./scripts/download_install_libraries.sh capnp install

- name: Install Libraries (Windows)
shell: pwsh
if: inputs.os == 'Windows'
run: |
./scripts/download_install_libraries.ps1 capnp install
43 changes: 43 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Build And Test"

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

permissions:
contents: read

jobs:
build:
name: Build And Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ] # , windows-latest ] , macos-latest ]

steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: ./.github/actions/setup-env
with:
os: ${{ runner.os }}

- uses: ./.github/actions/compile-library
with:
os: ${{ runner.os }}

- uses: ./.github/actions/run-linter
with:
os: ${{ runner.os }}

- uses: ./.github/actions/run-test
with:
os: ${{ runner.os }}
29 changes: 15 additions & 14 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Dependency Review'
on: [pull_request]
on: [ pull_request ]

permissions:
contents: read
Expand All @@ -9,17 +9,18 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Dependency Review
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
with:
comment-summary-in-pr: always
fail-on-severity: high
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0
fail-on-scopes: development, runtime
- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Dependency Review
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
with:
comment-summary-in-pr: always
fail-on-severity: high
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, BSD-2-Clause, Unlicense, CC0-1.0, 0BSD, X11, MPL-2.0, MPL-1.0, MPL-1.1, MPL-2.0
fail-on-scopes: development, runtime
47 changes: 0 additions & 47 deletions .github/workflows/documentation.yml

This file was deleted.

Loading