Skip to content

Commit

Permalink
💚 Fix CI test, doc and publish workflows
Browse files Browse the repository at this point in the history
* 💚 Fix CI test and publish workflows

fix ci test dep

* attempt to fix sphinx-docsearch

* attempt to fix sphinx-docsearch

* attempt to fix sphinx-docsearch
  • Loading branch information
Galileo-Galilei authored May 6, 2024
1 parent 164b2e5 commit 7224178
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,46 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.10"] # 3.10 is converted to 3.1 if not a string
python-version: ["3.8", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Check code formatting and linting
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' # linting should occur only once in the loop
- name: Check code formatting with ruff
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' # linting should occur only once in the loop
run: |
make lint
ruff format . --check
- name: Check import order and syntax with ruff
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' # linting should occur only once in the loop
#"F", # Pyflakes
#"E", # Pycodestyle
# "W", # Pycodestyle
# "UP", # pyupgrade
# "I", # isort
# "PL", # Pylint
# PLR0913 lines-too-long managed by "ruff format"
run: |
ruff check . --select F,E,W,UP,I,PL --ignore E,PLR0913 --exclude "/template/"
- name: Test with pytest and generate coverage report
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' # upload should occur only once in the loop
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' # upload should occur only once in the loop
with:
token: ${{ secrets.CODECOV_TOKEN }} # token is not mandatory but make access more stable
# use_oidc: true would better?
file: ./coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"sphinx_markdown_tables",
"myst_parser",
"sphinxawesome_theme",
"sphinxawesome_theme.docsearch",
"sphinx_docsearch", # before: "sphinxawesome_theme.docsearch",
"sphinxawesome_theme.highlighting",
]

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ def _parse_requirements(path, encoding="utf-8"):
install_requires=base_requirements,
extras_require={
"doc": [
"sphinx>=4.5.0,<7.2.0", # https://github.com/kai687/sphinxawesome-theme/issues/1464
"sphinx>=4.5.0,<7.3.0", # https://github.com/kai687/sphinxawesome-theme/issues/1464
"sphinxawesome-theme",
"sphinx-docsearch",
"sphinx-markdown-tables~=0.0.15",
"sphinx-click>=3.1,<4.5",
"sphinx-click>=3.1,<6.0",
"sphinx_copybutton~=0.5.0",
# "sphinx-sitemap",
"sphinx-design",
Expand Down

0 comments on commit 7224178

Please sign in to comment.