Skip to content

Commit 31cc60e

Browse files
authored
CI: Have nc-autotools use source distribution (#1)
Instead of a clone of the repository, have the nc-autotools job work from a source distribution prepared by a previous autotools CI job. This should catch most of the "files not included in EXTRA_DIST" or similar issues I remember, and probably most of the "netcdf-c does not pass make distcheck" errors.
1 parent 6676c68 commit 31cc60e

File tree

1 file changed

+85
-7
lines changed

1 file changed

+85
-7
lines changed

.github/workflows/run_tests_ubuntu.yml

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,19 @@ jobs:
195195
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
196196
if: ${{ success() }}
197197

198+
- name: Create source distribution
199+
shell: bash -l {0}
200+
if: ${{ success() }}
201+
run: make dist -j
202+
203+
- uses: actions/upload-artifact@v3
204+
with:
205+
name: netcdf-c-autotools-source-distribution
206+
path: |
207+
*.tar*
208+
*.zip
209+
*.tgz
210+
198211
##
199212
# Parallel
200213
##
@@ -448,7 +461,28 @@ jobs:
448461
use_nczarr: [ nczarr_off, nczarr_on ]
449462
steps:
450463

451-
- uses: actions/checkout@v3
464+
- uses: actions/download-artifact@v3
465+
with:
466+
name: netcdf-c-autotools-source-distribution
467+
468+
- name: Unpack source distribution
469+
shell: bash -l {0}
470+
run: |
471+
if [ -f *.zip ];
472+
then
473+
unzip *.zip
474+
else
475+
tar xvzf $(ls *.tar* *.tgz *.zip | head -1)
476+
fi
477+
ls -d netcdf-c*
478+
for name in netcdf-c*;
479+
do
480+
if [ -d ${name} ];
481+
then
482+
cd ${name}
483+
break
484+
fi
485+
done
452486
453487
- name: Install System dependencies
454488
shell: bash -l {0}
@@ -497,41 +531,85 @@ jobs:
497531

498532
- name: Run autoconf
499533
shell: bash -l {0}
500-
run: autoreconf -if
534+
run: |
535+
for name in netcdf-c*;
536+
do
537+
if [ -d ${name} ];
538+
then
539+
cd ${name}
540+
break
541+
fi
542+
done
543+
autoreconf -if
501544
502545
- name: Configure
503546
shell: bash -l {0}
504547
run: |
548+
for name in netcdf-c*;
549+
do
550+
if [ -d ${name} ];
551+
then
552+
cd ${name}
553+
break
554+
fi
555+
done
505556
current_directory="$(pwd)"
506557
mkdir ../build
507558
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} "${current_directory}/configure" ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}
508559
if: ${{ success() }}
509560

510561
- name: Look at config.log if error
511562
shell: bash -l {0}
512-
run: cd ../build && cat config.log
563+
run: |
564+
if [ -d ../build ];
565+
then
566+
cd ../build
567+
else
568+
cd build
569+
fi && cat config.log
513570
if: ${{ failure() }}
514571

515572
- name: Print Summary
516573
shell: bash -l {0}
517-
run: cd ../build && cat libnetcdf.settings
574+
run: |
575+
if [ -d ../build ];
576+
then
577+
cd ../build
578+
else
579+
cd build
580+
fi && cat libnetcdf.settings
518581
519582
- name: Build Library and Utilities
520583
shell: bash -l {0}
521584
run: |
522-
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
585+
if [ -d ../build ];
586+
then
587+
cd ../build
588+
else
589+
cd build
590+
fi && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
523591
if: ${{ success() }}
524592

525593
- name: Build Tests
526594
shell: bash -l {0}
527595
run: |
528-
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
596+
if [ -d ../build ];
597+
then
598+
cd ../build
599+
else
600+
cd build
601+
fi && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
529602
if: ${{ success() }}
530603

531604
- name: Run Tests
532605
shell: bash -l {0}
533606
run: |
534-
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
607+
if [ -d ../build ];
608+
then
609+
cd ../build
610+
else
611+
cd build
612+
fi && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
535613
if: ${{ success() }}
536614

537615
nc-cmake:

0 commit comments

Comments
 (0)