Skip to content

Commit

Permalink
Merge pull request #2910 from WardF/add_windows_runner.wif
Browse files Browse the repository at this point in the history
Add CI for a Windows Runner on Github Actions.
  • Loading branch information
WardF committed Apr 17, 2024
2 parents 6dc3789 + e153c8a commit 2e40e7c
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 94 deletions.
163 changes: 163 additions & 0 deletions .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
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_test:
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: msys2/setup-msys2@v2
with:
update: true
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: ""
auto-activate-base: true

- name: Set up Paths and env
shell: bash -el {0}
run: |
echo "" >> ~/.bash_profile
cat ~/.bash_profile
- name: Dump Matrix Context
run: echo '${{ toJSON(matrix) }}'

#- run: echo "CMAKE_PREFIX_PATH=${env.CONDA_PREFIX}/Library" >> $GITHUB_ENV
#- run: echo "/c/Users/runneradmin/miniconda3/Library/lib:${GITHUB_PATH}" >> $GITHUB_ENV
#- run: echo ""
#- run: echo "CTEST_OUTPUT_ON_FAILURE=1" >> $GITHUB_ENV

# 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 }} m2-m4 libxml2
shell: bash -el {0}

# Double-check something
- name: Check Miniconda
run: |
which h5dump
which m4
shell: bash -el {0}

# Check current directory
- name: Query Current Environment
run: |
ls
echo ""
echo "PATH: $PATH"
echo ""
env
echo ""
ls $CONDA_PREFIX/Library
echo ""
ls $CONDA_PREFIX/Library/include/
shell: bash -el {0}

- name: Perform out-of-directory configuration
shell: bash -el {0}
run: |
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH="${CONDA_PREFIX}/Library" -DCMAKE_C_FLAGS="-I${CONDA_PREFIX}/Library/include" -DCMAKE_INSTALL_PREFIX=~/tmp -DNETCDF_ENABLE_FILTER_TESTING=OFF
if: ${{ success() }}

- name: View cache - configuration
shell: bash -el {0}
run: |
cd build
cmake -L .
if: ${{ success() }}

- name: Print Summary
shell: bash -el {0}
run: |
cd build
cat libnetcdf.settings
- name: Perform out-of-directory build - libnetcdf
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release --target netcdf -j 4
- name: Perform out-of-directory install - libnetcdf
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release --target install -j 4
if: ${{ success() }}

- name: View config.h - libnetcdf failure
shell: bash -el {0}
run: |
cd build
cat config.h
if: ${{ failure() }}

- name: Perform out-of-directory build - test suite
shell: bash -el {0}
run: |
cd build
cmake --build . --config Release -j 4
if: ${{ success() }}

- name: View config.h - tests failure failure
shell: bash -el {0}
run: |
cd build
cat config.h
if: ${{ failure() }}

- name: Prepare ctest Paths and env
shell: bash -el {0}
run: |
cat ~/.bash_profile
echo "" >> ~/.bash_profile
- name: Run ctest
shell: bash -el {0}
run: |
echo "Run ctest PATH: $PATH"
echo "Run ctest combined PATH: $PATH"
echo "Run ctest combined GITHUB_PATH: $PATH"
cd build
PATH=~/tmp/bin:$PATH ctest . -j 4 -E 'bom' --output-on-failure
- name: Verbose Output if CTest Failure
shell: bash -el {0}
run: |
cd build
PATH=~/tmp/bin:$PATH ctest . --rerun-failed --output-on-failure -VV
if: ${{ failure() }}
12 changes: 6 additions & 6 deletions .github/workflows/run_tests_cdash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
hdf5: [ 1.10.8, 1.12.2, 1.14.3 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -32,7 +32,7 @@ jobs:
###
- name: Cache libhdf5-${{ matrix.hdf5 }}
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -81,7 +81,7 @@ jobs:
###
- name: Cache libhdf5-parallel-${{ matrix.hdf5 }}
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-parallel-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
hdf5: [ 1.10.8, 1.12.2, 1.14.3 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
CDASH_TOKEN: ${{ secrets.CDASH_TOKEN }}
env:
Expand All @@ -153,7 +153,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# libhdf5
###
- name: Cache libhdf5-${{ runner.os }}-${{ matrix.hdf5 }}
id: cache-hdf5-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
use_nczarr: [ nczarr_off, nczarr_on ]
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# Set Environmental Variables
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
use_nczarr: [ nczarr_off, nczarr_on ]
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# Set Environmental Variables
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf5-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
hdf5: [ 1.12.2, 1.14.3 ]
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# Set Environmental Variables
Expand All @@ -277,7 +277,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# Set Environmental Variables
Expand All @@ -357,7 +357,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf5-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -416,7 +416,7 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

###
# Set Environmental Variables
Expand All @@ -432,7 +432,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf5-osx
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run_tests_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
hdf5: [ 1.10.8, 1.12.2, 1.14.3 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -37,7 +37,7 @@ jobs:
###
- name: Cache libhdf5-${{ matrix.hdf5 }}
id: cache-hdf5
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
hdf5: [ 1.14.3 ]
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install System dependencies
shell: bash -l {0}
Expand All @@ -94,7 +94,7 @@ jobs:

- name: Fetch HDF Cache
id: cache-hdf
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/environments/${{ matrix.hdf5 }}
key: hdf5-${{ runner.os }}-${{ matrix.hdf5 }}
Expand Down
Loading

0 comments on commit 2e40e7c

Please sign in to comment.