forked from EESSI/software-layer-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 2.09 KB
/
test-eb-hooks.yml
File metadata and controls
56 lines (50 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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"