Skip to content

Commit

Permalink
🎉 Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed Jan 2, 2025
0 parents commit d8a1ac6
Show file tree
Hide file tree
Showing 19 changed files with 798 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build

on:
push:
branches: [main]
pull_request:
branches: [main, staging]

jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.12"
- os: ubuntu-latest
python: "3.12"
pip-flags: "--pre"
group: ["unit", "docs"]
timeout-minutes: 15

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

- uses: actions/checkout@v4
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
with:
repository: laminlabs/lndocs
ssh-key: ${{ secrets.READ_LNDOCS }}
path: lndocs
ref: main

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install git+https://github.com/laminlabs/laminci
# - run: sudo apt-get -y install graphviz

- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Run lint
if: matrix.group == 'unit'
run: nox -s lint

- name: Run build
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
run: nox -s "build(group='${{ matrix.group }}')"

- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: cloudflare/wrangler-action@v3
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
id: cloudflare
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 472bdad691b4483dea759eadb37110bd
command: pages deploy "_build/html" --project-name=PROJECTNAME
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: edumserrano/find-create-or-update-comment@v2
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Deployment URL"
comment-author: "github-actions[bot]"
body: |
Deployment URL: ${{ steps.cloudflare.outputs.deployment-url }}
edit-mode: replace
23 changes: 23 additions & 0 deletions .github/workflows/doc-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: doc-changes

on:
pull_request_target:
branches:
- main
types:
- closed

jobs:
latest-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install "laminci[doc-changes]@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
- run: laminci doc-changes
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
changelog_file: PATH_TO_CHANGELOG_FILE
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# mypy
.mypy_cache/

# IDE settings
.vscode/
.idea/

# Lamin
_build
docs/moscan.*
lamin_sphinx
docs/conf.py
_docs_tmp*
51 changes: 51 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
fail_fast: false
default_language_version:
python: python3
default_stages:
- commit
- push
minimum_pre_commit_version: 2.12.0
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.4
hooks:
- id: prettier
exclude: |
(?x)(
docs/changelog.md
)
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
exclude: |
(?x)(
docs/examples/|
docs/notes/
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
exclude: |
(?x)(
.github/workflows/latest-changes.jinja2
)
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
additional_dependencies: ["types-requests", "types-attrs"]
Loading

0 comments on commit d8a1ac6

Please sign in to comment.