Skip to content

Commit fa975c1

Browse files
lochhhniksirbi
andauthored
Standardise make files (#35)
* Add sg_execution_times.rst to clean target in Makefile * Allow chaining commands in make.bat * Use make in CI --------- Co-authored-by: niksirbi <niko.sirbiladze@gmail.com>
1 parent 8f17ad7 commit fa975c1

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.github/workflows/docs_build_and_deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
with:
3232
python-version: "3.13"
3333
use-requirements-txt: false
34+
use-make: true
3435
github-token: ${{ secrets.GITHUB_TOKEN }}
3536

3637
deploy_sphinx_docs:
@@ -45,3 +46,4 @@ jobs:
4546
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs@v2
4647
with:
4748
secret_input: ${{ secrets.GITHUB_TOKEN }}
49+
use-make: true

docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ clean:
1919
rm -rf $(BUILDDIR)
2020
rm -rf $(SOURCEDIR)/api_generated
2121
rm -rf $(SOURCEDIR)/auto_examples
22+
rm -f $(SOURCEDIR)/sg_execution_times.rst
2223

2324
# Catch-all target: route all unknown targets to Sphinx using the new
2425
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

docs/make.bat

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,20 @@ if errorlevel 9009 (
2525

2626
if "%1" == "" goto help
2727

28-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
28+
:process_targets
29+
if "%1" == "clean" (
30+
if exist "%BUILDDIR%" rmdir /s /q "%BUILDDIR%"
31+
if exist "%SOURCEDIR%\api_generated" rmdir /s /q "%SOURCEDIR%\api_generated"
32+
if exist "%SOURCEDIR%\auto_examples" rmdir /s /q "%SOURCEDIR%\auto_examples"
33+
if exist "%SOURCEDIR%\sg_execution_times.rst" del /q "%SOURCEDIR%\sg_execution_times.rst"
34+
) else (
35+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
36+
if errorlevel 1 goto end
37+
)
38+
39+
shift
40+
if not "%1" == "" goto process_targets
41+
2942
goto end
3043

3144
:help

0 commit comments

Comments
 (0)