Skip to content

Commit

Permalink
[ci] add automated check for unchecksummed versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolkl committed Mar 27, 2021
1 parent 373d86f commit e5c4121
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/scripts/generate_new_version_issue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

package_list=$(spack maintainers --by-user vvolkl mirguest tmadlener)

# todo: add packages by hep/key4hep label also?

# prune duplicates (needed if package list is appended to)
#package_list=$(echo ${package_list} | tr ' ' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/[[:space:]]*$//')

for p in ${package_list}; do
v=$(spack versions --new $p)
# ignore pre and rc versions
v=$(echo $v | sed 's/\S*\(rc\|pre\|alpha\)\S*//g')
if [[ ! -z "$v" ]]; then
echo $p: $v >> gh-new-version.log
fi
done

14 changes: 14 additions & 0 deletions .github/scripts/post_new_version_issue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
generate_new_version_data()
{
cat <<EOF
{
"title": "[bot] Found new package versions to checksum",
"body": "$(cat gh-new-version.log | sed -z 's/\n/\\n/g')",
"labels:" "new-version"
}
EOF
}
curl -s -H "Authorization: token ${KEY4HEP_COMMENT_BOT_TOKEN}" \
-X POST -d "$(generate_post_data)" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/"

33 changes: 33 additions & 0 deletions .github/workflows/check-new-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: concretize-ubuntu

on:
schedule:
- cron: "0 13 * * 1" # Every Monday at 1PM UTC (9AM EST)

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup spack
run: |
mkdir ${GITHUB_WORKSPACE}/../spack
cd ${GITHUB_WORKSPACE}/../spack
git clone --depth 1 https://github.com/key4hep/spack .
cp -r ${GITHUB_WORKSPACE} var/spack/repos/
cp var/spack/repos/$(basename ${GITHUB_REPOSITORY})/config/packages.yaml etc/spack
source share/spack/setup-env.sh
spack repo add --scope site ${PWD}/var/spack/repos/$(basename ${GITHUB_REPOSITORY})
- name: Check for new versions
run: |
cd ${GITHUB_WORKSPACE}/../spack
source share/spack/setup-env.sh
- name: Check for New Versions and Create Issue
env:
KEY4HEP_COMMENT_BOT_TOKEN: ${{ secrets.KEY4HEP_COMMENT_BOT_TOKEN }}
run: |
cd ${GITHUB_WORKSPACE}/../spack
source share/spack/setup-env.sh
${GITHUB_WORKSPACE}/.github/scripts/generate_new_version_issue.sh
${GITHUB_WORKSPACE}/.github/scripts/post__new_version_issue.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
*.log
*.swp
*.lock
.spack-env
Expand Down

0 comments on commit e5c4121

Please sign in to comment.