Skip to content

Commit

Permalink
fix workflows (#237)
Browse files Browse the repository at this point in the history
* ruff docs checks all the time

* check code in docs for every main pushes

* check docs more often

* check notebook more often

* remove auto publish for now
  • Loading branch information
mbrunel authored May 16, 2024
1 parent fc9a317 commit 7605e17
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 193 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/docs-checker.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: spellcheck & README link checker
name: spellcheck & link checker

on:
push:
paths:
- 'docs/**'
- 'README.md'
- '.github/.pyspelling.yaml'
- '.github/lavague-dic.txt'
schedule:
- cron: '20 8,17 * * *'

jobs:
spellcheck:
Expand All @@ -30,7 +28,7 @@ jobs:
- name: Spellcheck Markdown files
run: |
pyspelling -c .github/.pyspelling.yaml
check-README-links:
runs-on: ubuntu-latest
steps:
Expand All @@ -42,11 +40,26 @@ jobs:

- name: Check links in README.md
run: markdown-link-check README.md

check-docs-links:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y linkchecker
- name: Check links
id: linkcheck
run: linkchecker https://docs.lavague.ai/en/latest/

notify:
runs-on: ubuntu-latest
needs: check-README-links
if: ${{ failure() || needs.check-README-links.outcome == 'failure' }}
if: ${{ failure() || needs.check-README-links.outcome == 'failure' || needs.check-docs-links.outcome == 'failure' }}
steps:
- name: Send failure notification via Discord
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/docs-code.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: Python Code Check
name: Python Code Check in docs and README

on:
push:
branches:
- main
paths:
- 'README.md'
- 'docs/index.md'
- 'pyproject.toml'

jobs:
check-code:
Expand Down Expand Up @@ -41,11 +37,30 @@ jobs:
- name: Run the Python script
run: |
python check-code.py
execute-notebook:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install Python dependencies and nbconvert
run: pip install notebook nbconvert lavague

- name: Execute the notebook
run: jupyter nbconvert --to notebook --execute --inplace --output executed_notebook.ipynb docs/docs/get-started/quick-tour-notebook/quick-tour.ipynb

notify:
runs-on: ubuntu-latest
needs: [ check-code]
if: ${{ failure() || needs.check-code.outcome == 'failure' }}
if: ${{ failure() || needs.check-code.outcome == 'failure' || needs.execute-notebook.outcome == 'failure'}}
steps:
- name: Send failure notification via Discord
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/docs-links.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Software test, formatting & publishing
name: Formatting

on:
push:
paths:
- 'src/lavague/**.py'

jobs:
lint:
name: Run Ruff Linter
format:
name: Run Ruff format checker
runs-on: ubuntu-latest

steps:
Expand All @@ -22,8 +20,5 @@ jobs:
- name: Install Ruff
run: pip install ruff

- name: Run Ruff on src/lavague
run: ruff format .

- name: Run Ruff on examples
run: ruff format examples/
- name: Run ruff
run: ruff format --check .
95 changes: 0 additions & 95 deletions .github/workflows/publish.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/quick-tour.yaml

This file was deleted.

0 comments on commit 7605e17

Please sign in to comment.