Skip to content

Commit

Permalink
Merge branch 'BradyAJohnston:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tubiana committed Jun 21, 2023
2 parents c03dfd6 + 7bddb9e commit 58f4027
Show file tree
Hide file tree
Showing 128 changed files with 20,793 additions and 1,899 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: docs-build-deploy

on:
workflow_dispatch:
push:
branches: ["main", "docs-*"]
pull_request:
release:
types: [published]

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install quartodoc
python -m pip install pyyaml
python -m pip install click
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.2.475"
- name: Build docs
run: |
make docs-build
# push to netlify -------------------------------------------------------

# set release name ----

- name: Configure pull release name
if: ${{github.event_name == 'pull_request'}}
run: |
echo "RELEASE_NAME=pr-${PR_NUMBER}" >> $GITHUB_ENV
env:
PR_NUMBER: ${{ github.event.number }}
- name: Configure branch release name
if: ${{github.event_name != 'pull_request'}}
run: |
# use branch name, but replace slashes. E.g. feat/a -> feat-a
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
# deploy ----

- name: Create Github Deployment
uses: bobheadxi/deployments@v0.4.3
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ env.RELEASE_NAME }}
ref: ${{ github.head_ref }}
transient: true
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'

- name: Netlify docs preview
run: |
npm install -g netlify-cli
# push main branch to production, others to preview --
if [ "${ALIAS}" == "main" ]; then
netlify deploy --dir=docs/_build --alias="main"
else
netlify deploy --dir=docs/_build --alias="${ALIAS}"
fi
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
ALIAS: ${{ steps.deployment.outputs.env }}

- name: Update Github Deployment
uses: bobheadxi/deployments@v0.4.3
if: ${{ always() }}
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: 'https://${{ steps.deployment.outputs.env }}--molecularnodes.netlify.app'
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
- uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'release'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build
43 changes: 0 additions & 43 deletions .github/workflows/qurto-publish.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: test-addon

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
fail-fast: false
matrix:
blender-version: ["3.5.0"]
os: [ubuntu-latest, windows-latest]
# os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
cache: 'pip'
- run: pip install bpy==${{ matrix.blender-version }}
- run: pip install -r requirements.txt

- name: Install MolecularNodes
run: pip install .

- name: Run Tests
run: pytest --verbose --cov=MolecularNodes --cov-report=xml:coverage.xml

- name: Expose coverage as a CI download # Related to test_addon_blender_advanced.py
uses: actions/upload-artifact@v1
with:
name: coverage.xml
path: coverage.xml
# setup ssh to check on file system state
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
*.blend1
__pycache__/*
logs/side-packages-install.log
.vscode/*
*.zip
*.log
*.pyc
.Rproj.user
docs
.quarto
.DS_Store
MolecularNodes/dev.py
/.quarto/
*egg*/*
build/*
.hypothesis/unicode_data/13.0.0/charmap.json.gz
coverage.xml
.coverage
*.npz
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include MolecularNodes/assets/*
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
docs-build:
cd docs && quartodoc build
quarto render docs

test:
pip install .
pytest -vv

version := $(shell grep -o -E "\b[0-9]+\.[0-9]+\.[0-9]+\b" pyproject.toml)

release:
git clean -dfX
zip -r MolecularNodes_$(version).zip MolecularNodes -x *pycache* *.blend1
Loading

0 comments on commit 58f4027

Please sign in to comment.