Skip to content

Commit

Permalink
Merge branch 'main' into feature/web-dashboard-api
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 authored Jun 26, 2024
2 parents 8c04205 + 9b9a47b commit dbda5c9
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 143 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- .github/workflows/integration_tests.yml
- '**.py'
- poetry.lock
- pyproject.toml
Expand All @@ -17,6 +18,7 @@ on:
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- .github/workflows/integration_tests.yml
- '**.py'
- poetry.lock
- pyproject.toml
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: docs

on:
pull_request:
branches:
- main
paths:
- .pre-commit-config.yaml
- .github/workflows/docs.yml
- '**.py'
- '**.ipynb'
- '**.html'
- '**.jinja'
- '**.js'
- poetry.lock
- pyproject.toml
- '**.rst'
- '**.md'
- docs/cyclops-webpage
types: [opened, synchronize, closed]
push:
branches:
- main
paths:
- .pre-commit-config.yaml
- .github/workflows/docs.yml
- '**.py'
- '**.ipynb'
- '**.html'
- '**.jinja'
- '**.js'
- poetry.lock
- pyproject.toml
- '**.rst'
- '**.md'
- docs/cyclops-webpage

jobs:
build:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || (github.event.action == 'closed' && github.event.pull_request.merged == true)))
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
- name: Install dependencies, run unit tests and coverage report
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies, build docs without running notebooks
run: |
python3 -m pip install --upgrade pip && python3 -m pip install poetry
# Install Pandoc
PANDOC_VERSION="2.19"
curl -sLo- "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C /usr/local/bin --exclude="share"
poetry env use '3.10'
source $(poetry env info --path)/bin/activate
poetry install --with docs,test --all-extras
cd docs
rm -rf source/reference/api/_autosummary
make html SPHINXOPTS="-D nbsphinx_execute='never'"
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Build webpage
run: |
cd docs/cyclops-webpage
yarn install --frozen-lockfile
yarn build
cp -r ../build/html build/api
- name: Deploy to GitHub Pages
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true)
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: github_pages
publish_dir: docs/cyclops-webpage/build
65 changes: 0 additions & 65 deletions .github/workflows/docs_build.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/docs_deploy.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: docs release

on:
pull_request:
branches:
- main
paths:
- .pre-commit-config.yaml
- .github/workflows/docs_release.yml
- '**.py'
- '**.ipynb'
- '**.html'
- '**.jinja'
- '**.js'
- poetry.lock
- pyproject.toml
- '**.rst'
- '**.md'
- docs/cyclops-webpage
types: [labeled, closed]

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'release') || (github.event.action == 'closed' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
- name: Install dependencies, run unit tests and coverage report
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies, build docs with notebooks
run: |
python3 -m pip install --upgrade pip && python3 -m pip install poetry
# Install Pandoc
PANDOC_VERSION="2.19"
curl -sLo- "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C /usr/local/bin --exclude="share"
poetry env use '3.10'
source $(poetry env info --path)/bin/activate
poetry install --with docs,test --all-extras
cd docs
rm -rf source/reference/api/_autosummary
make html
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Build webpage
run: |
cd docs/cyclops-webpage
yarn install --frozen-lockfile
yarn build
cp -r ../build/html build/api
- name: Deploy to GitHub Pages
if: github.event.action == 'closed' && github.event.pull_request.merged == true
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: github_pages
publish_dir: docs/cyclops-webpage/build
6 changes: 1 addition & 5 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- .github/workflows/docs_build.yml
- .github/workflows/docs_deploy.yml
- .github/workflows/integration_tests.yml
- '**.py'
- '**.ipynb'
Expand All @@ -26,8 +24,6 @@ on:
paths:
- .pre-commit-config.yaml
- .github/workflows/code_checks.yml
- .github/workflows/docs_build.yml
- .github/workflows/docs_deploy.yml
- .github/workflows/integration_tests.yml
- '**.py'
- '**.ipynb'
Expand Down Expand Up @@ -57,7 +53,7 @@ jobs:
ompi_info
poetry env use '3.10'
source $(poetry env info --path)/bin/activate
env MPICC=/opt/openmpi-4.1.5/bin/mpicc poetry install --with docs,dev,test --all-extras
env MPICC=/opt/openmpi-4.1.5/bin/mpicc poetry install --with dev,test --all-extras
mpirun -n 2 python -m pytest --only-mpi
pytest -m integration_test --cov-report term --cov-report xml:./coverage.xml --cov=cyclops -n auto --dist loadscope
- name: Upload coverage to Codecov
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: unit tests

on:
push:
branches:
- main
paths:
- .github/workflows/unit_tests.yml
- '**.py'
- '**.html'
- '**.jinja'
- '**.js'
- poetry.lock
- pyproject.toml
pull_request:
branches:
- main
paths:
- .github/workflows/unit_tests.yml
- '**.py'
- '**.html'
- '**.jinja'
- '**.js'
- poetry.lock
- pyproject.toml

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install dependencies, run unit tests and coverage report
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
- uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'poetry'
- run: |
python3 -m pip install --upgrade pip && python3 -m pip install poetry
poetry env use '3.10'
source $(poetry env info --path)/bin/activate
poetry install --with test --all-extras
pytest -m "not integration_test" --cov-report term --cov-report xml:./coverage.xml --cov=cyclops -n auto --dist loadscope
- name: Upload coverage to Codecov
uses: Wandalen/[email protected]
with:
action: codecov/[email protected]
with: |
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: codecov-umbrella
fail_ci_if_error: true
attempt_limit: 5
attempt_delay: 30000

0 comments on commit dbda5c9

Please sign in to comment.