diff --git a/.github/workflows/test-scripts.yml b/.github/workflows/test-scripts.yml new file mode 100644 index 0000000000..7258598631 --- /dev/null +++ b/.github/workflows/test-scripts.yml @@ -0,0 +1,32 @@ +# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions +name: Tests for scripts in EESSI software layer +on: [push, pull_request] +jobs: + build: + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + python: [2.7, 3.5, 3.6, 3.7, 3.8] + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{matrix.python}} + architecture: x64 + + - name: install OS & Python packages + run: | + pip install archspec + + - name: test scripts + run: | + python eessi_cpu_subdir.py + source init_eessi.sh + # check which $EESSI_* environment variables were defined + env | grep '^EESSI' | sort + # make sure there are no empty subpaths + echo "$EESSI_PATH" | grep -v '//' diff --git a/eessi_cpu_subdir.py b/eessi_cpu_subdir.py new file mode 100644 index 0000000000..88599c70b7 --- /dev/null +++ b/eessi_cpu_subdir.py @@ -0,0 +1,10 @@ +# Determine subdirectory of EESSI prefix to use, based on CPU microarchitecture of host +import os +import archspec.cpu + +host_cpu = archspec.cpu.host() + +cpu_family = host_cpu.family.name +cpu_codename = host_cpu.name + +print(os.path.join(cpu_family, cpu_codename)) diff --git a/init_eessi.sh b/init_eessi.sh new file mode 100644 index 0000000000..41887aa5dc --- /dev/null +++ b/init_eessi.sh @@ -0,0 +1,8 @@ +echo "Initializing environment for EESSI..." + +export EESSI_MOUNT="/tmp/cvmfs" +export EESSI_REPO="pilot.eessi-hpc.org" +export EESSI_CPU_SUBDIR="$(python eessi_cpu_subdir.py)" +export EESSI_PATH="$EESSI_MOUNT/$EESSI_REPO/$EESSI_CPU_SUBDIR" + +echo ">> EESSI path: $EESSI_PATH"