Skip to content

Commit

Permalink
Merge PR #2512 to remove reusable workflow logic from CI workflow
Browse files Browse the repository at this point in the history
Re-using the RMG-Py workflow removes the ability to (easily) run the tests from forks or to target forks, 
so we will instead copy the testing action and test files to RMG-database. 
The workflow will be similar but (as mentioned below) can skip some steps.
  • Loading branch information
rwest committed Aug 1, 2023
2 parents 65dfeca + 10a1c33 commit 5be8b0e
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,24 @@ on:
push:
# runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py)
pull_request:
# allow calling from other repos in the ReactionMechanismGenerator organization
workflow_call:
inputs:
rmg-db-branch:
# if calling from RMG-database, must provide a branch
required: true
type: string

# this prevents one PR from simultaneously running multiple runners, which will clog up the queue
# and prevent other PRs from running the CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
# main with the name of the branch
RMG_DATABASE_BRANCH: main


jobs:
build-osx:
runs-on: macos-latest
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
env:
# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
# main with the name of the branch
RMG_DATABASE_BRANCH: main
defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -88,14 +83,7 @@ jobs:
mamba list
# Clone RMG-database
- name: Clone RMG-database - Reusable Workflow
if: github.repository == 'ReactionMechanismGenerator/RMG-database'
run: |
cd ..
git clone -b ${{ inputs.rmg-db-branch }} https://github.com/ReactionMechanismGenerator/RMG-database.git
- name: Clone RMG-database - RMG-Py
if: github.repository != 'ReactionMechanismGenerator/RMG-database'
- name: Clone RMG-database
run: |
cd ..
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git
Expand All @@ -118,10 +106,6 @@ jobs:
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
env:
# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
# main with the name of the branch
RMG_DATABASE_BRANCH: main

# This is true only if this is a reference case for the regression testing:
REFERENCE_JOB: ${{ github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }}
defaults:
Expand Down Expand Up @@ -151,13 +135,7 @@ jobs:
mamba list
# Clone RMG-database
- name: Clone RMG-database - Reusable Workflow
if: github.repository == 'ReactionMechanismGenerator/RMG-database'
run: |
cd ..
git clone -b ${{ inputs.rmg-db-branch }} https://github.com/ReactionMechanismGenerator/RMG-database.git
- name: Clone RMG-database - RMG-Py
- name: Clone RMG-database
if: github.repository != 'ReactionMechanismGenerator/RMG-database'
run: |
cd ..
Expand Down

0 comments on commit 5be8b0e

Please sign in to comment.