|
33 | 33 | # and then allow for special cases for specific architectures |
34 | 34 | aarch64/a64fx: [] |
35 | 35 | jobs: |
| 36 | + # Checks whether this PR modifies any easystack files and, if so, |
| 37 | + # determines which EESSI versions are affected. |
| 38 | + # It then stores those versions as a space-separated list in an |
| 39 | + # environment variable. |
| 40 | + # Finally, it writes that value to GITHUB_OUTPUT using the correct |
| 41 | + # heredoc format. |
| 42 | + check_EESSI_version_changed_files: |
| 43 | + runs-on: ubuntu-24.04 |
| 44 | + outputs: |
| 45 | + EESSI_VERSIONS: ${{ steps.detect.outputs.EESSI_VERSIONS }} |
| 46 | + steps: |
| 47 | + - name: Check out software-layer repository |
| 48 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 49 | + with: |
| 50 | + fetch-depth: 0 # Fetch all history for all branches and tags |
| 51 | + |
| 52 | + - name: Detect EESSI version in modified easystack files |
| 53 | + id: detect |
| 54 | + run: | |
| 55 | + # Fetch base branch explicitly to ensure it's available |
| 56 | + git fetch origin ${{ github.base_ref }} |
| 57 | +
|
| 58 | + changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) |
| 59 | + echo "Files changed: $changed_files" |
| 60 | +
|
| 61 | + # Default to not checking missing software for any version |
| 62 | + EESSI_VERSIONS="" |
| 63 | + |
| 64 | + # Check for specific versions in the changed easystack files |
| 65 | + EESSI_VERSIONS=$(git diff --name-only origin/${{ github.base_ref }}...HEAD \ |
| 66 | + | grep -oP 'easystacks/software\.eessi\.io/\K[0-9]{4}\.[0-9]{2}' \ |
| 67 | + | sort -u \ |
| 68 | + | tr '\n' ' ') |
| 69 | + echo "PR easystack changes related to EESSI VERSION: $EESSI_VERSIONS" |
| 70 | + |
| 71 | + # Use GITHUB_OUTPUT heredoc correctly |
| 72 | + echo "EESSI_VERSIONS<<EOF" >> "$GITHUB_OUTPUT" |
| 73 | + echo "$EESSI_VERSIONS" >> "$GITHUB_OUTPUT" |
| 74 | + echo "EOF" >> "$GITHUB_OUTPUT" |
| 75 | +
|
36 | 76 | check_missing: |
| 77 | + needs: check_EESSI_version_changed_files |
37 | 78 | strategy: |
38 | 79 | fail-fast: false |
39 | 80 | matrix: |
@@ -153,6 +194,7 @@ jobs: |
153 | 194 | cvmfs_repositories: software.eessi.io |
154 | 195 |
|
155 | 196 | - name: Check for missing installlations |
| 197 | + if: contains(needs.check_EESSI_version_changed_files.outputs.EESSI_VERSIONS, matrix.EESSI_VERSION) |
156 | 198 | run: | |
157 | 199 | export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} |
158 | 200 | source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash |
|
0 commit comments