Skip to content

Commit

Permalink
Test docs on PR; deploy docs on push to default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
peytondmurray committed Aug 17, 2023
1 parent a6d57df commit a336059
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build docs
on:
pull_request:
workflow_call:

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Setup Graphviz
run: |
sudo apt install graphviz -y
- name: Install versioned-hdf5
run: |
pip install .[doc]
- name: Build docs
working-directory: docs
run: |
# Need to set timezone to avoid a sphinx/babel issue
# when using act to run locally:
# https://github.com/nektos/act/issues/1853
TZ=UTC make html
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build/html/*
47 changes: 47 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy static content to Pages

on:
push:
branches: ["master"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
uses: deshaw/versioned-hdf5/.github/workflows/docs.yml@master

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Download docs
uses: actions/download-artifact@v3
with:
name: docs
path: docs

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
6 changes: 0 additions & 6 deletions rever.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,9 @@ $ACTIVITIES = [
'push_tag', # Pushes the tag up to the $TAG_REMOTE
# 'ghrelease', # Creates a Github release entry for the new tag
'pypi', # Sends the package to pypi
# 'ghpages',
]

$PUSH_TAG_REMOTE = '[email protected]:deshaw/versioned-hdf5.git' # Repo to push tags to

$GITHUB_ORG = 'deshaw' # Github org for Github releases and conda-forge
$GITHUB_REPO = 'versioned-hdf5' # Github repo for Github releases and conda-forge

$GHPAGES_REPO = '[email protected]:deshaw/versioned-hdf5.git'
$GHPAGES_COPY = $GHPAGES_COPY = (
('docs/_build/html', '$GHPAGES_REPO_DIR'),
)
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
extras_require={
"test": [
"pytest",
],
"doc": [
"sphinx",
"myst-parser",
]
}
)
4 changes: 1 addition & 3 deletions versioned_hdf5/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
HLObject,
Dataset,
Group,
File,
__version__ as h5py_version
)
from h5py._hl.vds import VDSmap
Expand Down Expand Up @@ -480,9 +479,8 @@ def _walk(g: HLObject, prefix: str = '') -> List[str]:

return datasets


def delete_versions(
f: Union[VersionedHDF5File, File],
f: Union[VersionedHDF5File, 'h5py.File'],
versions_to_delete: Iterable[str]
):
"""Completely delete the given versions from a file
Expand Down

0 comments on commit a336059

Please sign in to comment.