Skip to content

Commit a385fbc

Browse files
committed
WIP: testin sphinx build + artifacts x18
1 parent cc69f1d commit a385fbc

File tree

2 files changed

+86
-64
lines changed

2 files changed

+86
-64
lines changed

.github/workflows/documentation.yml

Lines changed: 82 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ jobs:
2525
run: |
2626
conda env create -f environment.yml
2727
28-
- name: Update cache with newly created environment
29-
uses: actions/cache@v2
30-
with:
31-
path: C:\Miniconda\envs\diff_check
32-
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
28+
# - name: Update/Restore conda environment cache
29+
# uses: actions/cache@v2
30+
# with:
31+
# path: C:\Miniconda\envs\diff_check
32+
# key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
33+
# restore-keys: |
34+
# ${{ runner.os }}-conda-
3335

3436
- name: Activate diff_check conda environment
3537
run: |
@@ -42,71 +44,90 @@ jobs:
4244
- name: CMake Build
4345
run: conda run --name diff_check --no-capture-output cmake --build build --config Release
4446

45-
- name: Move dlls and pyd files to a single directory
46-
run: |
47-
mkdir $env:GITHUB_WORKSPACE\artifacts
48-
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\Release -Filter *.pyd -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts
49-
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\bin\Release -Filter *.dll -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts
50-
shell: pwsh
51-
- name: Store the dlls/pyd as artifacts
52-
uses: actions/upload-artifact@v2
53-
with:
54-
name: __build_artifacts__
55-
path: ${{ github.workspace }}/artifacts/*
56-
57-
58-
build-docs:
59-
runs-on: windows-latest
60-
needs: build-source
61-
62-
steps:
63-
- name: Checkout repository
64-
uses: actions/checkout@v4
65-
with:
66-
lfs: true # enable lfs support
67-
68-
- name: Setup conda environment
69-
uses: conda-incubator/setup-miniconda@v2
70-
with:
71-
auto-update-conda: true
72-
python-version: 3.9.1
73-
74-
- name: Restore conda environment cache
75-
uses: actions/cache@v2
76-
with:
77-
path: C:\Miniconda\envs\diff_check
78-
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
79-
restore-keys: |
80-
${{ runner.os }}-conda-
8147

82-
- name: Activate diff_check conda environment
48+
# TODO: testing copying
49+
- name: Copying the dlls for python tests and c++ tests
8350
run: |
84-
conda activate diff_check
51+
echo "Copying dlls/pyds for sphinx docs"
52+
copy ${{github.workspace}}/build/bin/Release/*.dll ${{github.workspace}}/doc
53+
copy ${{github.workspace}}/build/Release/*.pyd ${{github.workspace}}/doc
8554
86-
- name: Download dlls/pyd artifacts
87-
uses: actions/download-artifact@v2
88-
with:
89-
name: __build_artifacts__
90-
path: ${{github.workspace}}/doc
55+
echo "Copying dlls/pyds for python diffCheck package"
56+
copy ${{github.workspace}}/build/bin/Release/*.dll ${{github.workspace}}/src/gh/diffCheck/diffCheck/dlls
57+
copy ${{github.workspace}}/build/Release/*.pyd ${{github.workspace}}/src/gh/diffCheck/diffCheck
9158
92-
# TODO: debug
93-
- name: List all the files in doc/
59+
- name: Sphinx build
9460
run: |
95-
ls doc
61+
invoke documentize
9662
97-
# TODO: testing import with test file test_pybind_dll_smoke.py to remove
98-
- name: tester test_pybind_dll_smoke.py with conda run
99-
run: |
100-
conda run -n diff_check python doc/test_pybind_dll_smoke.py
101-
working-directory: ${{github.workspace}}
10263
103-
-
10464
65+
# # FIXME: uploading artifacts
66+
# - name: Move dlls and pyd files to a single directory
67+
# run: |
68+
# mkdir $env:GITHUB_WORKSPACE\artifacts
69+
# Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\Release -Filter *.pyd -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts
70+
# Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\bin\Release -Filter *.dll -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts
71+
# shell: pwsh
72+
# - name: Store the dlls/pyd as artifacts
73+
# uses: actions/upload-artifact@v2
74+
# with:
75+
# name: __build_artifacts__
76+
# path: ${{ github.workspace }}/artifacts/*
10577

106-
- name: Sphinx build
107-
run: |
108-
conda run --name diff_check --no-capture-output sphinx-build doc _build
109-
working-directory: ${{github.workspace}}
78+
79+
# build-docs:
80+
# runs-on: windows-latest
81+
# needs: build-source
82+
83+
# steps:
84+
# - name: Checkout repository
85+
# uses: actions/checkout@v4
86+
# with:
87+
# lfs: true # enable lfs support
88+
89+
# - name: Setup conda environment
90+
# uses: conda-incubator/setup-miniconda@v2
91+
# with:
92+
# auto-update-conda: true
93+
# python-version: 3.9.1
94+
95+
# - name: Restore conda environment cache
96+
# uses: actions/cache@v2
97+
# with:
98+
# path: C:\Miniconda\envs\diff_check
99+
# key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
100+
# restore-keys: |
101+
# ${{ runner.os }}-conda-
102+
103+
# - name: Activate diff_check conda environment
104+
# run: |
105+
# conda activate diff_check
106+
107+
# - name: Download dlls/pyd artifacts
108+
# uses: actions/download-artifact@v2
109+
# with:
110+
# name: __build_artifacts__
111+
# path: ${{github.workspace}}/doc
112+
113+
# # TODO: debug
114+
# - name: List all the files in doc/
115+
# run: |
116+
# ls doc
117+
118+
# # TODO: testing import with test file test_pybind_dll_smoke.py to remove
119+
# - name: tester test_pybind_dll_smoke.py with conda run
120+
# run: |
121+
# conda run -n diff_check python doc/test_pybind_dll_smoke.py
122+
# working-directory: ${{github.workspace}}
123+
124+
# # -
125+
126+
127+
# - name: Sphinx build
128+
# run: |
129+
# conda run --name diff_check --no-capture-output sphinx-build doc _build
130+
# working-directory: ${{github.workspace}}
110131

111132

112133

doc/test_pybind_dll_smoke.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
import sys
66

77
# Import the C++ bindings
8-
extra_dll_dir = os.path.join(os.path.dirname(__file__), "./")
9-
os.add_dll_directory(extra_dll_dir) # For finding DLL dependencies on Windows
8+
extra_dll_dir = os.path.abspath(os.path.dirname(__file__))
9+
print(f"extra_dll_dir: {extra_dll_dir}")
1010
sys.path.append(extra_dll_dir) # Add this directory to the Python path
11+
# os.add_dll_directory(extra_dll_dir) # For finding DLL dependencies on Windows
1112
try:
12-
import diffcheck_bindings as dfb
13+
import diffCheck.diffcheck_bindings as dfb
1314
except ImportError as e:
1415
print(f"Failed to import diffcheck_bindings: {e}")
1516
print("Current sys.path directories:")

0 commit comments

Comments
 (0)