From d4ccc8a9d6ae6a8512511bb60c6a8486de1b5ab6 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Fri, 28 Jul 2023 19:47:02 -0400 Subject: [PATCH 1/7] fix ci reusable workflow to checkout the correct rmg-py --- .github/workflows/CI.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a13e807029..f07e42b1a2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -65,11 +65,16 @@ jobs: run: shell: bash -l {0} steps: - - name: Checkout RMG-Py + - name: Checkout RMG-Py - Resuable Workflow + if: github.repository == 'ReactionMechanismGenerator/RMG-database' uses: actions/checkout@v3 with: repository: ReactionMechanismGenerator/RMG-Py + - name: Clone RMG-Py - RMG-Py + if: github.repository != 'ReactionMechanismGenerator/RMG-database' + uses: actions/checkout@v3 + # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 uses: conda-incubator/setup-miniconda@v2 From daecd87824279836971a385b385b2a0e1a365b3a Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 10:00:49 -0400 Subject: [PATCH 2/7] add the checkout fix to the linux runner as well --- .github/workflows/CI.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f07e42b1a2..3e1db206df 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -133,11 +133,16 @@ jobs: run: shell: bash -l {0} steps: - - name: Checkout RMG-Py + - name: Checkout RMG-Py - Resuable Workflow + if: github.repository == 'ReactionMechanismGenerator/RMG-database' uses: actions/checkout@v3 with: repository: ReactionMechanismGenerator/RMG-Py + - name: Clone RMG-Py - RMG-Py + if: github.repository != 'ReactionMechanismGenerator/RMG-database' + uses: actions/checkout@v3 + # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 uses: conda-incubator/setup-miniconda@v2 From acfac2c096fcf388e4a77216f6a3a773a930becf Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 13:15:06 -0400 Subject: [PATCH 3/7] =?UTF-8?q?=C2=AF\=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit squash this commit --- .github/workflows/CI.yml | 145 +++++++++++++++++++++++++-------------- 1 file changed, 92 insertions(+), 53 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3e1db206df..4f841e935e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,6 +41,10 @@ on: # allow calling from other repos in the ReactionMechanismGenerator organization workflow_call: inputs: + rmg-py-branch: + default: "main" + required: false + type: string rmg-db-branch: # if calling from RMG-database, must provide a branch required: true @@ -52,28 +56,98 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace +# main with the name of the branch +env: + RMG_DATABASE_BRANCH: main + jobs: - build-osx: - runs-on: macos-latest + clone: + runs-on: ubuntu-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} steps: - - name: Checkout RMG-Py - Resuable Workflow + # Option 1: calling from branch on RMG/RMG-Py and using branch on RMG/RMG-database + - name: Checkout RMG-Py + if: github.repository == 'ReactionMechanismGenerator/RMG-Py' + uses: actions/checkout@v3 + with: + repository: ReactionMechanismGenerator/RMG-Py + path: RMG-Py + - name: Checkout RMG-database + if: github.repository == 'ReactionMechanismGenerator/RMG-Py' + uses: actions/checkout@v3 + with: + repository: ReactionMechanismGenerator/RMG-database + path: RMG-database + ref: ${RMG_DATABASE_BRANCH} + + # Option 2: calling from fork of RMG-Py and using branch on RMG/RMG-database + - name: Checkout RMG-Py + if: github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event.repository.name == 'RMG-Py' + uses: actions/checkout@v3 + with: + repository: ${{ github.event.repository.owner }}/RMG-Py + path: RMG-Py + - name: Checkout RMG-database + if: github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event.repository.name == 'RMG-Py' + uses: actions/checkout@v3 + with: + repository: ReactionMechanismGenerator/RMG-database + path: RMG-database + ref: ${RMG_DATABASE_BRANCH} + + # Option 3: calling from branch on RMG-database + - name: Checkout RMG-Py if: github.repository == 'ReactionMechanismGenerator/RMG-database' uses: actions/checkout@v3 with: repository: ReactionMechanismGenerator/RMG-Py + path: RMG-Py + ref: ${{ inputs.rmg-py-branch }} + - name: Checkout RMG-database + if: github.repository == 'ReactionMechanismGenerator/RMG-database' + uses: actions/checkout@v3 + with: + repository: ReactionMechanismGenerator/RMG-database + path: RMG-database + ref: ${{ inputs.rmg-db-branch }} - - name: Clone RMG-Py - RMG-Py - if: github.repository != 'ReactionMechanismGenerator/RMG-database' + # Option 4: calling from fork on RMG-database + - name: Checkout RMG-Py + if: github.repository != 'ReactionMechanismGenerator/RMG-database' && github.event.repository.name == 'RMG-database' + uses: actions/checkout@v3 + with: + repository: ${{ github.event.repository.owner }}/RMG-Py + path: RMG-Py + ref: ${{ inputs.rmg-py-branch }} + - name: Checkout RMG-database + if: github.repository != 'ReactionMechanismGenerator/RMG-database' && github.event.repository.name == 'RMG-database' uses: actions/checkout@v3 + with: + repository: ${{ github.event.repository.owner }}/RMG-database + path: RMG-database + ref: ${{ inputs.rmg-db-branch }} + + - name: Pass Repos to Build and Test + uses: actions/upload-artifact@v3 + with: + name: repositories + path: $GITHUB_WORKSPACE + + build-osx: + needs: clone + runs-on: macos-latest + # skip scheduled runs from forks + defaults: + run: + shell: bash -l {0} + steps: + - name: Fetch Repos + uses: actions/download-artifact@v3 + with: + name: repositories + path: $GITHUB_WORKSPACE # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 @@ -92,19 +166,6 @@ jobs: mamba info 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' - run: | - cd .. - git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # modify env variables as directed in the RMG installation instructions - name: Set Environment Variables run: | @@ -119,29 +180,20 @@ jobs: make build-and-test-linux: + needs: clone runs-on: ubuntu-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 - + env: # 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: run: shell: bash -l {0} steps: - - name: Checkout RMG-Py - Resuable Workflow - if: github.repository == 'ReactionMechanismGenerator/RMG-database' - uses: actions/checkout@v3 + - name: Fetch Repos + uses: actions/download-artifact@v3 with: - repository: ReactionMechanismGenerator/RMG-Py - - - name: Clone RMG-Py - RMG-Py - if: github.repository != 'ReactionMechanismGenerator/RMG-database' - uses: actions/checkout@v3 + name: repositories + path: $GITHUB_WORKSPACE # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 @@ -160,19 +212,6 @@ jobs: mamba info 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' - run: | - cd .. - git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # modify env variables as directed in the RMG installation instructions - name: Set Environment Variables run: | From 7602d9cfb8b7ce38516774e3d627f0e47704d1c0 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 13:18:44 -0400 Subject: [PATCH 4/7] =?UTF-8?q?=C2=AF\=5F(=E3=83=84)=5F/=C2=AF=20=C2=AF\?= =?UTF-8?q?=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4f841e935e..e3ca30cd42 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -80,7 +80,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: ${RMG_DATABASE_BRANCH} + ref: $${ RMG_DATABASE_BRANCH }} # Option 2: calling from fork of RMG-Py and using branch on RMG/RMG-database - name: Checkout RMG-Py @@ -95,7 +95,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: ${RMG_DATABASE_BRANCH} + ref: $${ RMG_DATABASE_BRANCH }} # Option 3: calling from branch on RMG-database - name: Checkout RMG-Py From 48d2d28b7a52013cfca17e6bf36473ff9054f472 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 13:21:55 -0400 Subject: [PATCH 5/7] what even are environment variables? --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e3ca30cd42..f69da0c62c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -80,7 +80,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: $${ RMG_DATABASE_BRANCH }} + ref: $RMG_DATABASE_BRANCH # Option 2: calling from fork of RMG-Py and using branch on RMG/RMG-database - name: Checkout RMG-Py @@ -95,7 +95,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: $${ RMG_DATABASE_BRANCH }} + ref: $RMG_DATABASE_BRANCH # Option 3: calling from branch on RMG-database - name: Checkout RMG-Py From fcd5d796186399321fd9ab2ffaa0d3c979c44ca8 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 13:27:45 -0400 Subject: [PATCH 6/7] computers were a mistake --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f69da0c62c..4a00c12b89 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -80,7 +80,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: $RMG_DATABASE_BRANCH + ref: ${{ env.RMG_DATABASE_BRANCH }} # Option 2: calling from fork of RMG-Py and using branch on RMG/RMG-database - name: Checkout RMG-Py @@ -95,7 +95,7 @@ jobs: with: repository: ReactionMechanismGenerator/RMG-database path: RMG-database - ref: $RMG_DATABASE_BRANCH + ref: ${{ env.RMG_DATABASE_BRANCH }} # Option 3: calling from branch on RMG-database - name: Checkout RMG-Py @@ -133,7 +133,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: repositories - path: $GITHUB_WORKSPACE + path: ${{ github.workspace }} build-osx: needs: clone @@ -147,7 +147,7 @@ jobs: uses: actions/download-artifact@v3 with: name: repositories - path: $GITHUB_WORKSPACE + path: ${{ github.workspace }} # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 @@ -193,7 +193,7 @@ jobs: uses: actions/download-artifact@v3 with: name: repositories - path: $GITHUB_WORKSPACE + path: ${{ github.workspace }} # configures the mamba environment manager and builds the environment - name: Setup Mambaforge Python 3.7 From 7e382a4f905b5229d9abda493ddb6fb99986c4ec Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Mon, 31 Jul 2023 13:32:17 -0400 Subject: [PATCH 7/7] ugh --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4a00c12b89..774479e130 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -87,7 +87,7 @@ jobs: if: github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event.repository.name == 'RMG-Py' uses: actions/checkout@v3 with: - repository: ${{ github.event.repository.owner }}/RMG-Py + repository: ${{ github.repository_owner }}/RMG-Py path: RMG-Py - name: Checkout RMG-database if: github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event.repository.name == 'RMG-Py' @@ -118,14 +118,14 @@ jobs: if: github.repository != 'ReactionMechanismGenerator/RMG-database' && github.event.repository.name == 'RMG-database' uses: actions/checkout@v3 with: - repository: ${{ github.event.repository.owner }}/RMG-Py + repository: ${{ github.repository_owner }}/RMG-Py path: RMG-Py ref: ${{ inputs.rmg-py-branch }} - name: Checkout RMG-database if: github.repository != 'ReactionMechanismGenerator/RMG-database' && github.event.repository.name == 'RMG-database' uses: actions/checkout@v3 with: - repository: ${{ github.event.repository.owner }}/RMG-database + repository: ${{ github.repository_owner }}/RMG-database path: RMG-database ref: ${{ inputs.rmg-db-branch }}