Skip to content

Commit

Permalink
Try env
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Apr 19, 2024
1 parent f91eab4 commit 3f6de21
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
4 changes: 4 additions & 0 deletions bin/setup-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

which cobc
# printenv
11 changes: 11 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 3f6de21

Please sign in to comment.