-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt at adding windows-based Github Action CI #2908
Changes from 40 commits
7bce9a5
0b41547
edfd81b
43e90bf
2256184
42984bf
88222a6
795b1a0
991e870
6a2e261
be5f150
6d02348
11d72bb
a702a7e
e51b374
9ad193d
a0948d4
f24f93a
855a687
40470f2
29377ce
3c59493
6b79207
80723fa
7fe48c8
0852e08
9224b80
0986f01
0cde4a4
5d04300
18cfd74
b82d0d0
df61430
596eff5
cb2ef18
2398205
2d50595
0b1d609
584a7c7
45fdb6f
d37d6bf
53cdf4e
2eb0199
9790546
42838a9
a328fb8
91b37d5
a973bac
7b38d7b
2641e41
b1e56d9
fdb3aa1
b8b5835
d4f3c38
a722795
4bdd4a4
d06d38f
5a794d4
c95f098
d9216e7
bb6f49a
3ba92b6
b991cd5
b146a94
413b787
cce033f
3f27467
ac05986
5d9315b
eb35360
ca8539a
ccfcf0e
e79f26b
d61a2c5
6ad444a
c51ded4
243cda7
dc83236
57c400b
f2c77aa
0f0468c
1eb6882
26fbe6e
53ca392
2b13344
ae1d9e9
80742bd
de9112b
1acab85
963f6e4
18302cd
a38d149
f18da85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
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: 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) }}' | ||
|
||
- run: echo "CMAKE_PREFIX_PATH=${env.CONDA_PREFIX}/Library" >> $GITHUB_ENV | ||
- run: echo "PATH=${CONDA_PREFIX}/Library/lib:${PATH}" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Path separator on windows is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since I'm working in an MSYS2 shell, the guidance I'm finding seems to be that I should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However, clearly something is wrong, so I'll take a look. My priority is to get something that works so that I can move on with the release process, replacing Appveyor, and refine it afterwards. Premature optimization, and all that. |
||
- 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" | ||
if: ${{ success() }} | ||
|
||
- name: View cache - configuration | ||
shell: bash -el {0} | ||
run: | | ||
cd build | ||
cmake -L . | ||
if: ${{ success() }} | ||
|
||
- name: Print Summary | ||
shell: bash -l {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: 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: Run ctest | ||
shell: bash -el {0} | ||
env: | ||
PATH: ${CONDA_PREFIX}/Library/lib:${PATH} | ||
run: | | ||
echo "Path: ${PATH}" | ||
cd build | ||
ctest . -R nc_test -j 4 | ||
|
||
# - name: Verbose Output if CTest Failure | ||
# shell: bash -el {0} | ||
# run: | | ||
# cd build | ||
# ctest . -j 4 --rerun-failed --output-on-failure -VV | ||
# if: ${{ failure() }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What compilers do you want to target with this CI? You should specify the compiler used via
-DCMAKE_C_COMPILER
(or preferably presets) to make sure the appropriate compilers are used.For MSVC compilers, you would probably have to add
uses: ilammy/msvc-dev-cmd@v1
and point the compiler tocl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this will just be used with the Visual Studio compiler; I need to get a basic test in for Windows + Visual Studio. It will be expanded/revamped down the road, but I'd like to get this in for the v4.9.3 release we need to get out this week. Code compilation is running fine right now, the runtime errors being reported resolve to 'missing DLL', which suggests a pathing issue at runtime.