Skip to content

Commit fe67ea4

Browse files
committed
CI: Change autotools CI build to out-of-tree build.
This is a reference to an issue with how most distribution packagers run autotools (source in one directory, compile in another, install to a third. There was a PR to catch errors in that kind of build by running make distcheck; this should do the relevant bits of that PR, taking into account the preference for separate build and compile steps.
1 parent 17c7314 commit fe67ea4

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/run_tests_ubuntu.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,31 +501,37 @@ jobs:
501501

502502
- name: Configure
503503
shell: bash -l {0}
504-
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}
504+
run: |
505+
current_directory="$(pwd)"
506+
mkdir ../build
507+
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} "${current_directory}/configure" ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}
505508
if: ${{ success() }}
506509

507510
- name: Look at config.log if error
508511
shell: bash -l {0}
509-
run: cat config.log
512+
run: cd ../build && cat config.log
510513
if: ${{ failure() }}
511514

512515
- name: Print Summary
513516
shell: bash -l {0}
514-
run: cat libnetcdf.settings
517+
run: cd ../build && cat libnetcdf.settings
515518

516519
- name: Build Library and Utilities
517520
shell: bash -l {0}
518-
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
521+
run: |
522+
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make -j
519523
if: ${{ success() }}
520524

521525
- name: Build Tests
522526
shell: bash -l {0}
523-
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
527+
run: |
528+
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
524529
if: ${{ success() }}
525530

526531
- name: Run Tests
527532
shell: bash -l {0}
528-
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
533+
run: |
534+
cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check -j
529535
if: ${{ success() }}
530536

531537
nc-cmake:

0 commit comments

Comments
 (0)