Update ci.yml #28
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
# These are executed in Windows PowerShell | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
# run on latest https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | |
runs-on: windows-latest | |
env: | |
SOURCE_TAR: https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.35.0-Source.tar.gz?api=v2 | |
steps: | |
- name: Set up Git | |
run: git config --global core.symlinks true | |
- name: Activate Conda environment | |
# run: | | |
# "%CONDA%\Scripts\activate.bat" | |
# shell: cmd | |
uses: conda-incubator/setup-miniconda@v3.0.4 | |
with: | |
miniconda-version: "latest" | |
auto-activate-base: true | |
activate-environment: "" | |
# - name: Set up Conda | |
# run: conda config --set always_yes yes | |
# shell: cmd | |
- name: Download and extract source # pipe it to tar | |
run: | | |
mkdir -p %RUNNER_TEMP%\Source | |
curl %SOURCE_TAR% | tar -xz -f - -C %RUNNER_TEMP%\Source | |
shell: cmd | |
# curl -o sources.tar.gz $env:SOURCE_TAR | |
# 7z x -tgzip -so sources.tar.gz | 7z x -si -ttar | |
# - name: Install Linux utils from msys | |
# run: conda install -c msys2 m2-bash m2-findutils m2-coreutils m2-grep m2-sed m2-gawk m2-diffutils m2-perl | |
- name: Install cmake and other dependencies | |
run: | | |
conda install -c conda-forge cmake | |
conda install libpng openjpeg | |
- name: Build and install | |
run: | | |
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
echo Visual Studio %VSCMD_VER% | |
cd %RUNNER_TEMP%\Source | |
mkdir BUILD | |
cd BUILD | |
cmake -G "NMake Makefiles" | |
-D CMAKE_INSTALL_PREFIX=C:\ECMWF ^ | |
-D CMAKE_BUILD_TYPE=Release ^ | |
-D ENABLE_FORTRAN=0 ^ | |
-D ENABLE_PYTHON=0 ^ | |
-D ENABLE_NETCDF=0 ^ | |
-D ENABLE_PNG=1 ^ | |
-D ENABLE_JPG=1 ^ | |
-D OPENJPEG_INCLUDE_DIR=%CONDA%\Library\include\openjpeg-2.4.0 ^ | |
-D IEEE_LE=1 ^ | |
-D ENABLE_EXAMPLES=0 ^ | |
-D ENABLE_MEMFS=0 ^ | |
-D ENABLE_TESTS=0 ^ | |
-D ENABLE_EXTRA_TESTS=OFF ^ | |
.. | |
nmake install | |
copy "%CONDA%\Library\bin\openjp2.dll" "%RUNNER_TEMP%\Install\bin\" | |
copy "%CONDA%\Library\bin\libpng16.dll" "%RUNNER_TEMP%\Install\bin\" | |
copy "%CONDA%\Library\bin\zlib.dll" %RUNNER_TEMP%\Install\bin\" | |
shell: cmd | |
- name: Run tests | |
run: | | |
"$env:RUNNER_TEMP\Install\bin\codes_info.exe" | |
- name: Package artifacts | |
run: | | |
cd C:\ | |
7z a "%GITHUB_WORKSPACE%\EcCodes-win-x64.zip" "%RUNNER_TEMP%\Install" | |
shell: cmd | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: EcCodes-win-x64 | |
path: EcCodes-win-x64.zip |