WIP: testin sphinx build + artifacts x7 #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: documentation | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: write | |
jobs: | |
build-source: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true # enable lfs support | |
- name: Setup conda environment | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.9.1 | |
- name: Create diff_check conda environment | |
run: | | |
conda env create -f environment.yml | |
- name: Update cache with newly created environment | |
uses: actions/cache@v2 | |
with: | |
path: C:\Miniconda\envs\diff_check | |
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }} | |
- name: Activate diff_check conda environment | |
run: | | |
conda activate diff_check | |
- name: Cmake Configure | |
run: | | |
conda run --name diff_check --no-capture-output cmake -S . -B build -A x64 -DBUILD_PYTHON_MODULE=ON -DBUILD_TESTS=OFF -DRUN_TESTS=OFF | |
- name: CMake Build | |
run: conda run --name diff_check --no-capture-output cmake --build build --config Release | |
- name: Move dlls and pyd files to a single directory | |
run: | | |
mkdir $env:GITHUB_WORKSPACE\artifacts | |
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\Release -Filter *.pyd -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts | |
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\bin\Release -Filter *.dll -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts | |
shell: pwsh | |
- name: Store the dlls/pyd as artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: __build_artifacts__ | |
path: ${{ github.workspace }}/artifacts/* | |
build-docs: | |
runs-on: windows-latest | |
needs: build-source | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true # enable lfs support | |
- name: Setup conda environment | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.9.1 | |
- name: Restore conda environment cache | |
uses: actions/cache@v2 | |
with: | |
path: C:\Miniconda\envs\diff_check | |
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }} | |
restore-keys: | | |
${{ runner.os }}-conda- | |
- name: Activate diff_check conda environment | |
run: | | |
conda activate diff_check | |
- name: Download dlls/pyd artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: __build_artifacts__ | |
path: ${{github.workspace}}/doc | |
# TODO: debug | |
- name: List all the files in doc/ | |
run: | | |
ls doc | |
- name: Sphinx build | |
run: | | |
conda run --name diff_check --no-capture-output sphinx-build doc _build | |
working-directory: ${{github.workspace}} | |
# page-deployement: | |
# runs-on: windows-latest | |
## FIXME: we should replace this with the action to deploy to gh-pages | |
# - name: Deploy to GitHub Pages | |
# uses: peaceiris/actions-gh-pages@v3 | |
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
# with: | |
# publish_branch: gh-pages | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: _build/ | |
# force_orphan: true |