Skip to content

Commit

Permalink
Add check to scoring pipeline to ensure PR to master has been merge…
Browse files Browse the repository at this point in the history
…d (not just closed) (#456)

* rename test results step

* fix typo

* check if PR was merged (or just closed)

* cleanup

* update test results step name

---------

Co-authored-by: Katherine Fairchild <[email protected]>
  • Loading branch information
kvfairchild and Katherine Fairchild authored Jan 7, 2024
1 parent 6b7c639 commit bdc6c47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automerge_plugin-only_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Travis build status
- name: Get test results and ensure automergeable
id: gettestresults
run: |
echo "test_results=$( python brainscore_vision/submission/check_test_status.py ${{ github.event.pull_request.head.sha }} )"
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/score_new_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:

changes_models_or_benchmarks:
name: Check if PR makes changes to /models or /benchmarks
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
PLUGIN_INFO: ${{ steps.getpluginfo.outputs.PLUGIN_INFO }}
Expand All @@ -37,14 +38,14 @@ jobs:
with:
python-version: 3.7

- name: Save changed files to env var
run: echo "CHANGED_FILES=$(git diff --name-only origin/main~1 origin/$GITHUB_HEAD_REF | tr '\n' ' ')" >> $GITHUB_ENV

- name: Installing package dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install ".[test]"
- name: Save changed files to env var
run: echo "CHANGED_FILES=$(git diff --name-only origin/main~1 origin/$GITHUB_HEAD_REF | tr '\n' ' ')" >> $GITHUB_ENV

- name: Get plugin info
id: getpluginfo
run: |
Expand All @@ -58,7 +59,7 @@ jobs:
get_submitter_info:
name: Get PR author email and (if web submission) Brain-Score user ID
runs-on: ubuntu-latest
needs: [setup, changes_models_or_benchmarks]
needs: [changes_models_or_benchmarks]
if: ${{ needs.changes_models_or_benchmarks.outputs.RUN_SCORE == 'True' }}
env:
PLUGIN_INFO: ${{ needs.changes_models_or_benchmarks.outputs.PLUGIN_INFO }}
Expand Down Expand Up @@ -113,8 +114,11 @@ jobs:
with:
python-version: 3.7

- name: Build project and run scoring
- name: Build project
run: |
python -m pip install --upgrade pip setuptools
python -m pip install ".[test]"
- name: Run scoring
run: |
python -c 'from brainscore_core.submission.endpoints import call_jenkins; call_jenkins('\''${{ env.PLUGIN_INFO }}'\'')'

0 comments on commit bdc6c47

Please sign in to comment.