Skip to content

concretize-lxplus-comment-bot #185

concretize-lxplus-comment-bot

concretize-lxplus-comment-bot #185

name: concretize-lxplus-comment-bot
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check if workflow should be run
run: |
ismember=$(curl \
-o /dev/null --silent --head \
-H "Authorization: token ${{ secrets.COMMENT_TOKEN }}" \
--write-out '%{http_code}\n' \
https://api.github.com/orgs/key4hep/members/${GITHUB_ACTOR}\
)
echo "GITHUB_ACTOR: ${GITHUB_ACTOR}"
if [ "$ismember" = 204 ]
then
echo ""
else
exit 1
fi
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: cvmfs-contrib/github-action-cvmfs@v2
with:
cvmfs_repositories: 'sw.hsf.org,sw-nightlies.hsf.org,sft-nightlies.cern.ch,sft.cern.ch,geant4.cern.ch'
- name: Start container
run: |
docker run -it --name CI_container -e GITHUB_ENV=${GITHUB_ENV} -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash
- name: Setup Spack
run: |
docker exec CI_container /bin/bash -c 'cd ./Package
source scripts/ci_setup_spack.sh;'
- name: PR Comment
env:
KEY4HEP_COMMENT_BOT_TOKEN: ${{ secrets.KEY4HEP_COMMENT_BOT_TOKEN }}
run: |
docker exec CI_container /bin/bash -c 'cd ./Package
source spack/share/spack/setup-env.sh
spack repo add .
spack env activate environments/key4hep-release-user/
source environments/key4hep-release-user/setup_clingo_centos7.sh
spack add key4hep-stack
spack concretize -f | tee -a key4hep-stack-concretization.log
${GITHUB_WORKSPACE}/.github/scripts/generate_pr_comment.sh
${GITHUB_WORKSPACE}/.github/scripts/post_pr_comment.sh'