-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
achamma
committed
Jul 8, 2024
1 parent
13a71bb
commit c6b2642
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: psf/black@stable |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Documentation | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: main | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
# Force to use color | ||
FORCE_COLOR: true | ||
BROWSER: /usr/bin/firefox | ||
DISPLAY: :99.0 | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build_docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Install dependencies | ||
run: | | ||
pip install -r doc/doc-requirements.txt | ||
pip install -e . | ||
- name: Sphinx build | ||
id: build-docs | ||
run: | | ||
sphinx-build -b html doc doc/_build/html | ||
- name: Upload documentation | ||
if: steps.build-docs.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: DocHTML | ||
path: doc/_build/html | ||
|
||
deploy_on_main: | ||
runs-on: ubuntu-latest | ||
needs: [build_docs] | ||
if: ${{ contains(fromJSON('["push", "workflow_dispatch", "schedule"]'), github.event_name)}} | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: DocHTML | ||
path: doc/_build/html | ||
- name: Commit to main | ||
run: | | ||
git clone --depth 1 https://github.com/${{ github.repository_owner }}/hidimstat.git | ||
rm -Rf hidimstat/doc/_build | ||
mkdir hidimstat/doc/_build | ||
ls -a | ||
ls hidimstat | ||
ls hidimstat/doc | ||
cp -r doc/_build/html hidimstat/doc/_build | ||
cd hidimstat | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub actions" | ||
git add . | ||
git commit -m "Update documentation" -a || true | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
directory: hidimstat | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
# - name: Lint with flake8 | ||
# uses: py-actions/[email protected] | ||
- name: Generate coverage report | ||
run: | | ||
pip install pytest pytest-cov | ||
pytest --cov=./ --cov-report=xml | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Cache directories and files | ||
build | ||
dist | ||
doc | ||
examples/figures | ||
joblib | ||
.venv | ||
.pytest_cache | ||
.mypy_cache/ | ||
*.pyc | ||
__pycache__ | ||
*.egg-info | ||
.coverage | ||
|
||
# IDE specific folders | ||
.vscode | ||
|
||
.DS_Store | ||
coverage.xml | ||
|