1+ name : doc-build
2+
3+ on : [push, pull_request, workflow_dispatch]
4+
5+ permissions :
6+ contents : write
7+ pages : write
8+ id-token : write
9+
10+ jobs :
11+ build-source :
12+ runs-on : windows-latest
13+
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Setup conda environment
19+ uses : conda-incubator/setup-miniconda@v2
20+ with :
21+ auto-update-conda : true
22+ python-version : 3.9.1
23+
24+ - name : Create diff_check conda environment
25+ run : |
26+ conda env create -f environment.yml
27+
28+ - name : Cache 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+
34+ - name : Cmake Configure
35+ run : |
36+ conda run --name diff_check --no-capture-output cmake -S . -B build -A x64 -DBUILD_PYTHON_MODULE=ON -DBUILD_TESTS=OFF -DRUN_TESTS=OFF
37+
38+ - name : CMake Build
39+ run : conda run --name diff_check --no-capture-output cmake --build build --config Release
40+
41+ # upload artifacts
42+ - name : Move dlls and pyd files to single directories
43+ run : |
44+ mkdir $env:GITHUB_WORKSPACE\artifacts_dlls
45+ mkdir $env:GITHUB_WORKSPACE\artifacts_pyds
46+ Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\bin\Release -Filter *.dll -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts_dlls
47+ Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\Release -Filter *.pyd -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts_pyds
48+ shell : pwsh
49+ - name : Upload artifacts - dlls
50+ uses : actions/upload-artifact@v2
51+ with :
52+ name : __build_artifacts_dlls__
53+ path : ${{ github.workspace }}/artifacts_dlls/*
54+ - name : Upload artifacts - pyds
55+ uses : actions/upload-artifact@v2
56+ with :
57+ name : __build_artifacts_pyds__
58+ path : ${{ github.workspace }}/artifacts_pyds/*
59+
60+
61+ build-docs :
62+ runs-on : windows-latest
63+ needs : build-source
64+
65+ steps :
66+ - name : Checkout repository
67+ uses : actions/checkout@v4
68+
69+ - name : Setup conda environment
70+ uses : conda-incubator/setup-miniconda@v2
71+ with :
72+ auto-update-conda : true
73+ python-version : 3.9.1
74+
75+ - name : Restore conda environment cache
76+ uses : actions/cache@v2
77+ with :
78+ path : C:\Miniconda\envs\diff_check
79+ key : ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
80+ restore-keys : |
81+ ${{ runner.os }}-conda-
82+
83+ # download artifacts
84+ - name : Download dlls for doc folder
85+ uses : actions/download-artifact@v2
86+ with :
87+ name : __build_artifacts_dlls__
88+ path : ${{github.workspace}}/doc
89+ - name : Download pyds for doc folder
90+ uses : actions/download-artifact@v2
91+ with :
92+ name : __build_artifacts_pyds__
93+ path : ${{github.workspace}}/doc
94+ - name : Download dlls for diffCheck py package
95+ uses : actions/download-artifact@v2
96+ with :
97+ name : __build_artifacts_dlls__
98+ path : ${{github.workspace}}/src/gh/diffCheck/diffCheck/dlls
99+ - name : Download pyds for diffCheck py package
100+ uses : actions/download-artifact@v2
101+ with :
102+ name : __build_artifacts_pyds__
103+ path : ${{github.workspace}}/src/gh/diffCheck/diffCheck
104+
105+ - name : Sphinx build
106+ run : |
107+ conda run --name diff_check --no-capture-output sphinx-build -b html -v doc _build
108+
109+ - name : Upload documentation
110+ uses : actions/upload-artifact@v2
111+ with :
112+ name : __build_sphx_docs__
113+ path : ${{ github.workspace }}/_build
114+
115+
116+ page-deployement :
117+ environment :
118+ name : github-pages
119+ url : ${{ steps.deployment.outputs.page_url }}
120+ runs-on : ubuntu-latest
121+ needs : build-docs
122+ # Run only on pushes to the default branch
123+ if : github.ref == 'refs/heads/main'
124+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
125+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
126+ concurrency :
127+ group : " pages"
128+ cancel-in-progress : false
129+
130+ steps :
131+ - name : Checkout repository
132+ uses : actions/checkout@v4
133+
134+ - name : Download sphinx docs
135+ uses : actions/download-artifact@v2
136+ with :
137+ name : __build_sphx_docs__
138+ path : ${{github.workspace}}/_build
139+
140+ - name : Setup Pages
141+ uses : actions/configure-pages@v5
142+ - name : Upload artifact
143+ uses : actions/upload-pages-artifact@v3
144+ with :
145+ path : ' _build'
146+ - name : Deploy to GitHub Pages
147+ id : deployment
148+ uses : actions/deploy-pages@v4
0 commit comments