11#! /bin/bash
2+ # This script is designed to be run by Github Actions workflow
3+ # to trigger the RMG-tests at
4+ # https://github.com/reactionmechanismgenerator/rmg-tests
25
36set -e # exit with nonzero exit code if anything fails
47
5- echo ' Travis Build Dir: ' $TRAVIS_BUILD_DIR
8+ git config --global user.name " RMG Bot"
9+ git config --global user.email " rmg_dev@mit.edu"
610
7- if [ " $TRAVIS_PULL_REQUEST " != " false" ]; then
8- DEPLOY_BRANCH=$TRAVIS_PULL_REQUEST
9- else
10- DEPLOY_BRANCH=$TRAVIS_BRANCH
11- fi
11+ BRANCH=${GITHUB_REF# refs/ heads/ }
1212
13- # Deploy built site to this branch
14- echo " DEPLOY_BRANCH: $DEPLOY_BRANCH "
13+ echo " GITHUB_WORKSPACE: $GITHUB_WORKSPACE "
14+ echo " BRANCH: $BRANCH "
15+ echo " RMG_PY_BRANCH: $RMG_PY_BRANCH "
1516
1617# URL for the official RMG-tests repository
1718REPO=https://${GH_TOKEN} @github.com/ReactionMechanismGenerator/RMG-tests.git
1819
19- if [ -n " $TRAVIS_BUILD_ID " ]; then
20-
21- if [ " $TRAVIS_BRANCH " != " $DEPLOY_BRANCH " ]; then
22- echo " Travis should only deploy from the DEPLOY_BRANCH ($DEPLOY_BRANCH ) branch"
23- exit 0
24- elif [ " $TRAVIS_PULL_REQUEST " != " false" ]; then
25- echo " Travis should not deploy from pull requests"
26- exit 0
27- fi
28-
29- fi
30-
3120# create a temporary folder:
3221REPO_NAME=$( basename $REPO )
3322TARGET_DIR=$( mktemp -d /tmp/$REPO_NAME .XXXX)
@@ -41,14 +30,24 @@ cd $TARGET_DIR
4130
4231# create a new branch in RMG-tests with the name equal to
4332# the branch name of the tested RMG-database branch:
44- RMGTESTSBRANCH=rmgdb-$DEPLOY_BRANCH
33+ if [" $RMG_PY_BRANCH " == " master" ]
34+ then
35+ RMGTESTSBRANCH=rmgdb-$BRANCH
36+ else
37+ RMGTESTSBRANCH=rmgdbpy-$BRANCH
38+ fi
4539
46- git checkout -b $RMGTESTSBRANCH || true
40+ git checkout -b $RMGTESTSBRANCH || true
4741git checkout $RMGTESTSBRANCH
4842
49- # create an empty commit with the SHA-ID of the
43+ # create an empty commit with the SHA-ID of the
5044# tested commit of the RMG-database branch:
51- git commit --allow-empty -m rmgdb-$REV
45+ if [" $RMG_PY_BRANCH " == " master" ]
46+ then
47+ git commit --allow-empty -m rmgdb-$REV
48+ else
49+ git commit --allow-empty -m rmgdbpy-$REV -${RMG_PY_BRANCH}
50+ fi
5251
5352# push to the branch to the RMG/RMG-tests repo:
5453git push -f $REPO $RMGTESTSBRANCH > /dev/null
0 commit comments