Merge pull request #10209 from NREL/fix-water-heater-report-monthly-f… #16
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 Windows | |
on: | |
push: | |
branches: [ master, develop ] | |
env: | |
CMAKE_Fortran_COMPILER: "/c/msys64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout EnergyPlus | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install System dependencies and LaTeX | |
shell: bash | |
run: | | |
set -x | |
echo "Downloading MiKTeX CLI installer" | |
# We download from a specific miror already # TODO: Should store this setup package somewhere ourselves | |
curl -L -O https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-5.2.0%2Bb8f430f-x64.zip | |
unzip miktexsetup-5.2.0%2Bb8f430f-x64.zip | |
echo "Setting up the local package directory via download" | |
./miktexsetup_standalone --verbose \ | |
--local-package-repository=C:/MiKTeX-Repo \ | |
--remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \ | |
--package-set=essential \ | |
download | |
echo "Installing from the local package directory previously set up" | |
./miktexsetup_standalone --verbose \ | |
--local-package-repository=C:/MiKTeX-Repo \ | |
--package-set=essential \ | |
--shared=yes \ | |
install | |
echo "Adding MiKTeX bin folder to PATH and to GITHUB_PATH" | |
echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH | |
export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH" | |
echo "Configuring MiKTeX to install missing packages on the fly" | |
initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1' | |
echo "Configure default mirror for packages" | |
mpm --admin --set-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" | |
# If later we pre-package into a zip/tar.gz all the packages we need, we can preinstall them via | |
# mpm --admin --set-repository=C:/MiKTeX-Repo | |
# mpm --verbose --admin --repository=C:\MiKTeX-Repo --require=@C:\MiKTeX-Repo\energyplus_packages.lst | |
# Avoid annoying warning: "xelatex: major issue: So far, you have not checked for updates as a MiKTeX user." | |
mpm --find-updates | |
mpm --admin --find-updates | |
# initexmf --enable-installer --update-fndb | |
# initexmf --admin --enable-installer --update-fndb | |
# initexmf --enable-installer --dump-by-name=xelatex --engine=xetex | |
# This will install all required packages and does that in a single thread. So later in cmake we can safely run in parallel | |
- name: Install required packages by building the Test document | |
shell: bash | |
working-directory: ./doc/ | |
run: | | |
# It shaves about 1min40s to preinstall from the .lst so do it first | |
mpm --verbose --admin --require=@energyplus_packages_windows.lst | |
cd test/ | |
xelatex dependencies.tex | |
nwords=$(pdftotext -f 2 -l 2 dependencies.pdf - | wc -w) | |
[ "$nwords" -lt "10" ] && echo "TOC isn't available for pass NO. 1 (as expected)" || echo "TOC IS available for pass NO. 1" | |
xelatex dependencies.tex | |
nwords=$(pdftotext -f 2 -l 2 dependencies.pdf - | wc -w) | |
if [ "$nwords" -lt "10" ]; then | |
echo "TOC isn't available for pass NO. 2" | |
exit 1 | |
fi; | |
echo "TOC is available for pass NO.2" | |
- name: Create Build Directory | |
run: cmake -E make_directory ./doc/build/ | |
- name: Configure CMake | |
working-directory: ./doc/build | |
shell: bash | |
run: | | |
set -x | |
cmake -G "Visual Studio 16 2019" -A x64 -DTEX_INTERACTION=batchmode -DDOCS_TESTING=ON ../ | |
- name: Add problem matcher | |
run: echo "::add-matcher::.github/workflows/doc-problem-match.json" | |
- name: Build Docs | |
working-directory: ${{runner.workspace}}/EnergyPlus/doc/build | |
run: | | |
cmake --build . -j 2 | |
- name: Upload entire pdf folder | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: InputOutputReference | |
path: ${{runner.workspace}}/EnergyPlus/doc/build/pdf/ | |
- name: Upload log folder upon failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Xelatex_Logs_after_all | |
path: C:\Users\runneradmin\AppData\Local\MiKTeX\miktex\log\ |