From 3f6de2119368159dd365bbdb9638f9515292fc07 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 19 Apr 2024 13:44:34 +0200 Subject: [PATCH] Try env --- .github/workflows/test.yml | 26 +++++++++++++------------- bin/setup-environment | 4 ++++ bin/test | 11 +++++++++++ 3 files changed, 28 insertions(+), 13 deletions(-) create mode 100755 bin/setup-environment diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c773c94f..39bfb59e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,13 +29,13 @@ jobs: - name: Checkout repository uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 - - name: Cache GnuCOBOL - id: cache-gnu-cobol - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: | - ~/gnucobol - key: gnucobol-3.1.2-cobolcheck-v3 + # - name: Cache GnuCOBOL + # id: cache-gnu-cobol + # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + # with: + # path: | + # ~/gnucobol + # key: gnucobol-3.1.2-cobolcheck-v3 - name: Install dependencies # if: steps.cache-gnu-cobol.outputs.cache-hit != 'true' @@ -45,18 +45,18 @@ jobs: sudo apt-get -y --purge autoremove - name: Install GnuCOBOL - if: steps.cache-gnu-cobol.outputs.cache-hit != 'true' + # if: steps.cache-gnu-cobol.outputs.cache-hit != 'true' run: | + mkdir "${HOME}/gnucobol" curl -sLk https://sourceforge.net/projects/open-cobol/files/gnu-cobol/3.1/gnucobol-3.1.2.tar.gz | tar xz - cd gnucobol-3.1.2 && ./configure --prefix=${HOME}/gnucobol && sudo make && sudo make install && sudo ldconfig - sudo chown $(whoami) -R ${HOME}/gnucobol + cd gnucobol-3.1.2 && ./configure --prefix="${HOME}/gnucobol" && sudo make && sudo make install && sudo ldconfig + sudo chown $(whoami) -R "${HOME}/gnucobol" - name: Install CobolCheck - if: steps.cache-gnu-cobol.outputs.cache-hit != 'true' + # if: steps.cache-gnu-cobol.outputs.cache-hit != 'true' run: bin/fetch-cobolcheck - name: Run tests for all exercises run: | - ls -al $HOME/gnucobol/bin - export PATH=$HOME/gnucobol/bin:$PATH + bin/setup-environment bin/test diff --git a/bin/setup-environment b/bin/setup-environment new file mode 100755 index 00000000..64b00992 --- /dev/null +++ b/bin/setup-environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +which cobc +# printenv diff --git a/bin/test b/bin/test index 86aef431..3b06b577 100755 --- a/bin/test +++ b/bin/test @@ -18,6 +18,17 @@ # Example: # ./bin/test +ls -al "${HOME}/gnucobol" +ls -al "${HOME}/gnucobol/bin" +gnucobolDir="${HOME}/gnucobol" +export PATH="${gnucobolDir}/bin:${PATH}" +export COB_CONFIG_DIR="${gnucobolDir}/config" +export COB_COPY_DIR="${gnucobolDir}/copy" +export COB_CFLAGS="-I ${gnucobolDir}/include" +export COB_LDFLAGS="-L ${gnucobolDir}/lib" +export COB_LIBRARY_PATH="${gnucobolDir}/lib" +export COB_LIBS="${gnucobolDir}/bin/libcob-4.dll" + function verify_exercise() { local dir=$(realpath $1) local slug=$(basename "${dir}")