diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 85f400b824..a964d41b04 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,62 +1,19 @@ name: CI -on: [push] +on: [push, workflow_dispatch] # allow manual call jobs: - build-and-test-linux: + get-branch: runs-on: ubuntu-latest - strategy: - max-parallel: 5 - env: # update this if needed to match a pull request on the RMG-database - RMG_PY_BRANCH: main - defaults: - run: - shell: bash -l {0} + outputs: + branch: ${{ steps.extract_branch.outputs.branch }} steps: - - uses: actions/checkout@v2 - - name: Get RMG-Py source code - run: | - cd .. - git clone -b $RMG_PY_BRANCH https://github.com/ReactionMechanismGenerator/RMG-Py.git - cd RMG-Py - git clone -b arkanepy3 https://github.com/mjohnson541/Q2DTor.git external/Q2DTor - - uses: conda-incubator/setup-miniconda@v2 - with: - environment-file: ../RMG-Py/environment.yml - python-version: 3.7 - activate-environment: rmg_env - - name: Conda info - run: | - conda info - conda list - - name: Install MOPAC - env: - MOPACKEY: ${{ secrets.MOPACKEY }} - timeout-minutes: 1 - continue-on-error: true # allowed to fail on pull request from a forked repository - run: | - set +o pipefail - yes 'Yes' | ${CONDA_PREFIX}/bin/mopac "$MOPACKEY" - - name: Compile RMG - run: | - cd ../RMG-Py - make - - name: Trigger RMG-tests - if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' && github.ref != 'refs/heads/stable' }} # only push events to branches other than main and stable - env: - GH_TOKEN: ${{ secrets.RMG_DEV_TOKEN }} - run: ./trigger-rmg-tests.sh - - name: Unit tests - run: | - cd ../RMG-Py - make test-unittests - - name: Functional tests - if: ${{ success() || failure() }} # Run even if the unit tests failed (but not if they were cancelled) - run: | - cd ../RMG-Py - make test-functional - - name: Database tests - if: ${{ success() || failure() }} # Run even if the functional tests failed (but not if they were cancelled) - run: | - cd ../RMG-Py - make test-database + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + rmg-py-ci: + needs: get-branch + uses: ReactionMechanismGenerator/RMG-Py/.github/workflows/CI.yml@main + with: + rmg-db-branch: ${{ needs.get-branch.outputs.branch }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 73857615fe..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: c -sudo: false - -env: - global: - - secure: fd2HDrPvxMLHOXar7HyUZh0v+C5WkCfzhRzlBn+aePayrQn5FFrT68ENyr1v4sIpKESxYUOAwqtpDPUhF3M596GgGeU5yQc4q+sZmfwbVrjOvKCYuA5037vHmkWP1+mxQtRJMz/DC6vAoyasZkN5WD2n6WYIGupu/FxIJzYyzMM= - - secure: N/LNeY6kM4g2TOWiwuZhevrFOVSSDXj42hOWmbWVfwjLxVTMpFO29os3TiXxod8q6ezpDkXi5yVcGGtKLQZr6CgoiGW8zS+UKsUntKH4HI4dZdK+hKAKwaWU641aDNIq/XqSzNJ8v7ZmLLo3sk878aTHODPRPBfb7Q9wk2l3sDs= - - secure: jSRuOGP7vghJet6oelSprSLGBd/eYuUaU3UM+QnZW0GhETWyXxjg/17hpl2R2NzVLhVz2m0KRaoT9JmG+EyJ9NW47JwTaKL+CNtxg2gPTM3/6iVNdVrXM1vOTvaJhtZ/C2SbLDg/+JPLLUMfT9/9oXkiz+enh7VzZuZDywgoTsw= - - secure: Y4tbLIssPDkRQZp2lLUtou/YZr3APmhfD3o3tUcv1mqveeg6NBYZ8o6bLSULO3wdm88s1sug23VbP+Gt74XN4Ylbt4GjhKkOxvd+Vut7dR0o0cxsH372AWHYPicCOkuYAfeDK5cqxeXkGibHW1eBdduAAT82wcW5NcD9USyv9ig= - -stages: - - name: deploy - if: branch = stable AND type = push - -before_install: - - cd .. - # Install miniconda - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH=$HOME/miniconda/bin:$PATH - # Update conda - - conda update --yes conda - - conda info -a - - -jobs: - include: - - stage: deploy - install: - # Setup conda build - - conda install -y conda-build - - conda install -y anaconda-client - - conda config --add channels rmg - - conda config --set anaconda_upload yes - script: - - conda build --token $CONDA_TOKEN --user rmg RMG-database/.conda - - os: osx - install: - # Setup conda build - - conda install -y conda-build - - conda install -y anaconda-client - - conda config --add channels rmg - - conda config --set anaconda_upload yes - script: - - conda build --token $CONDA_TOKEN --user rmg RMG-database/.conda diff --git a/trigger-rmg-tests.sh b/trigger-rmg-tests.sh deleted file mode 100755 index 0d23fbcddd..0000000000 --- a/trigger-rmg-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# This script is designed to be run by Github Actions workflow -# to trigger the RMG-tests at -# https://github.com/reactionmechanismgenerator/rmg-tests - -set -e # exit with nonzero exit code if anything fails - -git config --global user.name "RMG Bot" -git config --global user.email "rmg_dev@mit.edu" - -BRANCH=${GITHUB_REF#refs/heads/} - -echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" -echo "BRANCH: $BRANCH" -echo "RMG_PY_BRANCH: $RMG_PY_BRANCH" - -# URL for the official RMG-tests repository -REPO=https://${GH_TOKEN}@github.com/ReactionMechanismGenerator/RMG-tests.git - -# create a temporary folder: -REPO_NAME=$(basename $REPO) -TARGET_DIR=$(mktemp -d /tmp/$REPO_NAME.XXXX) -REV=$(git rev-parse HEAD) - -# clone RMG-tests repo in the newly created folder: -git clone ${REPO} ${TARGET_DIR} - -# go inside the newly created folder: -cd $TARGET_DIR - -# create a new branch in RMG-tests with the name equal to -# the branch name of the tested RMG-database branch: -if [ "$RMG_PY_BRANCH" == "main" ] -then - RMGTESTSBRANCH=rmgdb-$BRANCH -else - RMGTESTSBRANCH=rmgdbpy-$BRANCH -fi - -git checkout -b $RMGTESTSBRANCH || true -git checkout $RMGTESTSBRANCH - -# create an empty commit with the SHA-ID of the -# tested commit of the RMG-database branch: -if [ "$RMG_PY_BRANCH" == "main" ] -then - git commit --allow-empty -m rmgdb-$REV -else - git commit --allow-empty -m rmgdbpy-$REV-${RMG_PY_BRANCH} -fi - -# push to the branch to the RMG/RMG-tests repo: -git push -f $REPO $RMGTESTSBRANCH > /dev/null