Skip to content

Attempt at adding windows-based Github Action CI #9

Attempt at adding windows-based Github Action CI

Attempt at adding windows-based Github Action CI #9

Workflow file for this run

name: NetCDF-C CMake CI - Windows
on: [pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
cmake_build_and_teset:
strategy:
matrix:
name:
- "Windows MSVC"
hdf5:
- "1.14.3"
# Visual Studio + CMake
include:
- name: "Windows MSVC"
os: windows-latest
generator: "-G \"Visual Studio 17 2022\""
name: "${{ matrix.name }}"
runs-on: ${{ matrix.os }}
# Each step in the job.
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: ""
auto-activate-base: true
- name: Dump Matrix Context
run: echo '${{ toJSON(matrix) }}'
- name: Set environment for MSVC (Windows)
run: |
# Set these environment variables so CMake picks the correct compiler
echo "CXX=cl.exe" >> $GITHUB_ENV
echo "CC=cl.exe" >> $GITHUB_ENV
if: matrix.os == 'windows-latest'
# Grab miniconda and use it to install HDF5
- name: Install Dependencies using Miniconda
run: |
conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
conda config --add channels conda-forge
conda update conda
conda install hdf5=${{ matrix.hdf5 }}
shell: bash -el {0}
# Double-check something
- name: Check Miniconda
run: |
which h5dump
env
shell: bash -el {0}
# Check current directory
- name: Query Current Environment
run: |
ls
echo ""
echo $PATH
echo ""
env
shell: bash -el {0}
# Install HDF5
# - name: Install HDF5
# run: |
# set -x
# curl https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$(echo ${{ matrix.hdf5 }} | cut -d. -f 1,2)/hdf5-${{ matrix.hdf5 }}/src/hdf5-$#{{ matrix.hdf5 }}.tar.bz2 --output hdf5-${{ matrix.hdf5 }}.tar.bz2
# tar -jxf hdf5-${{ matrix.hdf5 }}.tar.bz2
# pushd hdf5-${{ matrix.hdf5 }}
# mkdir build
# pushd build
# cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/environments/${{ matrix.hdf5 }}
# cmake --build . --config Release -j 4
# cmake --build . --config Release --target install -j 4
# shell: bash