Skip to content

rework CI workflow for missing installations to only check whether eb_hooks.py is up-to-date #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/test-eb-hooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Check whether eb_hooks.py script is up-to-date
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
env:
EESSI_VERSION: '2023.06'
jobs:
check_eb_hooks:
runs-on: ubuntu-24.04
steps:
- name: Check out software-layer repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Show host system info
run: |
echo "/proc/cpuinfo:"
cat /proc/cpuinfo
echo
echo "lscpu:"
lscpu

- name: Mount EESSI CernVM-FS pilot repository
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
with:
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
cvmfs_http_proxy: DIRECT
cvmfs_repositories: software.eessi.io

- name: Check that EasyBuild hook is up to date
if: ${{ github.event_name == 'pull_request' }}
run: |
FILE="eb_hooks.py"
TEMP_FILE="$(mktemp)"

# Fetch base branch
git fetch origin ${{ github.base_ref }}

# Check if the hooks has changed in the PR
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "^$FILE$"; then
echo "Hooks changed in PR. Using PR version."
cp "$FILE" "$TEMP_FILE"
else
echo "File not changed in PR. Using default branch version."
git show origin/${{ github.base_ref }}:$FILE > "$TEMP_FILE"
fi

# Compare the hooks to what is shipped in the repository
source /cvmfs/software.eessi.io/versions/${EESSI_VERSION}/init/bash
module load EESSI-extend
diff "$TEMP_FILE" "$EASYBUILD_HOOKS"
179 changes: 0 additions & 179 deletions .github/workflows/test-software.eessi.io.yml

This file was deleted.