|
1 | 1 | # documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions |
2 | | -name: Check whether eb_hooks.py script is up-to-date |
| 2 | +name: Run checks on EasyBuild hooks script |
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | pull_request: |
6 | 6 | workflow_dispatch: |
7 | 7 | permissions: |
8 | 8 | contents: read # to fetch code (actions/checkout) |
9 | 9 | jobs: |
10 | | - check_eb_hooks: |
| 10 | + check_eb_hooks_uptodate: |
11 | 11 | runs-on: ubuntu-24.04 |
12 | 12 | strategy: |
13 | 13 | matrix: |
14 | 14 | EESSI_VERSION: |
15 | 15 | - '2023.06' |
16 | 16 | - '2025.06' |
| 17 | + |
17 | 18 | steps: |
18 | 19 | - name: Check out software-layer repository |
19 | 20 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
20 | 21 | with: |
21 | 22 | fetch-depth: 0 # Fetch all history for all branches and tags |
22 | | - |
23 | | - - name: Show host system info |
24 | | - run: | |
25 | | - echo "/proc/cpuinfo:" |
26 | | - cat /proc/cpuinfo |
27 | | - echo |
28 | | - echo "lscpu:" |
29 | | - lscpu |
30 | | -
|
31 | | - - name: Mount EESSI CernVM-FS pilot repository |
32 | | - uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0 |
| 23 | + - name: Mount EESSI CernVM-FS repository |
| 24 | + uses: eessi/github-action-eessi@v3 |
33 | 25 | with: |
34 | | - cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb |
35 | | - cvmfs_http_proxy: DIRECT |
36 | | - cvmfs_repositories: software.eessi.io |
| 26 | + eessi_stack_version: ${{matrix.EESSI_VERSION}} |
| 27 | + use_eessi_module: true |
37 | 28 |
|
38 | | - - name: Check that EasyBuild hook is up to date |
| 29 | + - name: Check whether eb_hooks.py script is up-to-date |
39 | 30 | if: ${{ github.event_name == 'pull_request' }} |
40 | 31 | run: | |
41 | 32 | FILE="eb_hooks.py" |
|
57 | 48 | sed -i "s/<EESSI_VERSION>/${{matrix.EESSI_VERSION}}/g" "${TEMP_FILE}" |
58 | 49 |
|
59 | 50 | # Compare the hooks to what is shipped in the repository |
60 | | - source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash |
61 | 51 | module load EESSI-extend |
62 | 52 | diff "$TEMP_FILE" "$EASYBUILD_HOOKS" |
| 53 | +
|
| 54 | + check_eb_hooks_functionality: |
| 55 | + runs-on: ubuntu-24.04 |
| 56 | + strategy: |
| 57 | + matrix: |
| 58 | + EESSI_VERSION: |
| 59 | + - '2023.06' |
| 60 | + - '2025.06' |
| 61 | + include: |
| 62 | + # For each EESSI version we need to test different modules |
| 63 | + - EESSI_VERSION: '2023.06' |
| 64 | + COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb' |
| 65 | + INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb' |
| 66 | + # Pick a site toolchain that will allow the incompatible easyconfig |
| 67 | + # (the name will be modified when exported) |
| 68 | + SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "14.2.0"}]' |
| 69 | + - EESSI_VERSION: '2025.06' |
| 70 | + COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb' |
| 71 | + INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb' |
| 72 | + # Pick a site toolchain that will allow the incompatible easyconfig |
| 73 | + # (the name will be modified when exported) |
| 74 | + SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "13.2.0"}]' |
| 75 | + |
| 76 | + steps: |
| 77 | + - name: Check out software-layer repository |
| 78 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 79 | + |
| 80 | + - name: Mount EESSI CernVM-FS repository |
| 81 | + uses: eessi/github-action-eessi@v3 |
| 82 | + with: |
| 83 | + eessi_stack_version: ${{matrix.EESSI_VERSION}} |
| 84 | + use_eessi_module: true |
| 85 | + |
| 86 | + - name: Test that hook toolchain verification check works |
| 87 | + if: ${{ github.event_name == 'pull_request' }} |
| 88 | + run: | |
| 89 | + # Set up some environment variables |
| 90 | + export COMPATIBLE_EASYCONFIG=${{matrix.COMPATIBLE_EASYCONFIG}} |
| 91 | + export INCOMPATIBLE_EASYCONFIG=${{matrix.INCOMPATIBLE_EASYCONFIG}} |
| 92 | +
|
| 93 | + # Load specific EESSI-extend vertsion (proxies a version check) |
| 94 | + module load EESSI-extend/${{matrix.EESSI_VERSION}}-easybuild |
| 95 | +
|
| 96 | + # Test an easyconfig that should work |
| 97 | + eb --hooks=$PWD/eb_hooks.py "$COMPATIBLE_EASYCONFIG" --stop fetch |
| 98 | + echo "Success for hook with easyconfig $COMPATIBLE_EASYCONFIG with EESSI/${{matrix.EESSI_VERSION}}" |
| 99 | +
|
| 100 | + # Now ensure an incompatible easyconfig does not work |
| 101 | + eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch 2>&1 1>/dev/null | grep -q "not supported in EESSI" |
| 102 | + echo "Found expected failure for hook with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}" |
| 103 | +
|
| 104 | + # Check the override works |
| 105 | + EESSI_OVERRIDE_TOOLCHAIN_CHECK=1 eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch |
| 106 | + echo "Hook ignored via EESSI_OVERRIDE_TOOLCHAIN_CHECK with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}" |
| 107 | +
|
| 108 | + # Now check if we can set a site list of supported toolchains |
| 109 | + export SANITIZED_EESSI_VERSION=$(echo "${{ matrix.EESSI_VERSION }}" | sed 's/\./_/g') |
| 110 | + export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"='${{matrix.SITE_TOP_LEVEL_TOOLCHAINS}}' |
| 111 | + eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch |
| 112 | + echo "Site supported toolchain from $EESSI_SITE_TOP_LEVEL_TOOLCHAINS successfully used with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}" |
| 113 | +
|
| 114 | + # Make sure an invalid list of dicts fails |
| 115 | + export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"="Not a list of dicts" |
| 116 | + eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch 2>&1 1>/dev/null | grep -q "does not contain a valid list of dictionaries" |
| 117 | + echo "Incorrect format for EESSI_SITE_TOP_LEVEL_TOOLCHAINS caught" |
| 118 | +
|
0 commit comments