Merge pull request #641 from broadinstitute/qh/trio_stats #2428
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
pylint: | |
name: Pylint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Use pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
pip- | |
- name: Install dependencies | |
run: | | |
pip install wheel | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Check formatting | |
run: black --check gnomad_qc | |
- name: Check imports | |
run: isort --check-only gnomad_qc | |
- name: Check comment formatting | |
run: autopep8 --exit-code --diff gnomad_qc | |
- name: Run Pylint | |
run: ./lint --disable=W | |
- name: Check docstrings | |
run: pydocstyle --match-dir='(?!v2|cuKING).*' gnomad_qc | |
docs: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Use pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
pip- | |
- name: Install dependencies | |
run: | | |
pip install wheel | |
pip install -r requirements.txt | |
pip install -r docs/requirements.docs.txt | |
- name: Build docs | |
run: ./docs/build.sh | |
- name: Publish to GitHub Pages | |
if: github.event_name == 'push' | |
run: | | |
# Create empty gh-pages branch | |
git checkout --orphan gh-pages | |
# Remove files other than docs | |
git rm -rf . | |
find . -name __pycache__ | xargs rm -r | |
# Move docs to root | |
mv docs/html/* ./ | |
rm -r docs | |
# Tell GitHub not to treat this as a Jekyll site | |
touch .nojekyll | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add . | |
git commit --allow-empty -m "Update docs" | |
git push --force origin gh-pages | |
# Restore the original working tree by checking out the | |
# commit that triggered the workflow. | |
# This restores requirements.txt so that @actions/cache | |
# can use it for determining the cache key. | |
git checkout ${GITHUB_SHA} |