Skip to content

Commit

Permalink
Fixed various bugs in the 'score_new_plugins' workflow (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
shehadak authored Nov 18, 2023
1 parent d71764c commit b85a28f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/score_new_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,22 @@ jobs:
fetch-depth: 0

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

- name: Get scoring info
- name: Installing package dependencies
run: |
python -m pip install .
echo "PLUGIN_INFO=$(python -c 'from brainscore_core.plugin_management.parse_plugin_changes import get_scoring_info; get_scoring_info("${{ env.CHANGED_FILES }}", "brainscore_language")')" >> $GITHUB_OUTPUT
echo "RUN_SCORE=$(jq -r '.run_score' <<< "$PLUGIN_INFO")" >> $GITHUB_OUTPUT
python -m pip install --upgrade pip setuptools
python -m pip install ".[test]"
- name: Get plugin info
id: getpluginfo
run: |
echo "PLUGIN_INFO='$(python -c 'from brainscore_core.plugin_management.parse_plugin_changes import get_scoring_info; get_scoring_info("${{ env.CHANGED_FILES }}", "brainscore_language")')'" >> $GITHUB_OUTPUT
- name: Run scoring
id: runscore
run: |
echo "RUN_SCORE=$(jq -r '.run_score' <<< ${{ steps.getpluginfo.outputs.PLUGIN_INFO }})" >> $GITHUB_OUTPUT
get_submitter_info:
name: Get PR author email and (if web submission) Brain-Score user ID
Expand Down Expand Up @@ -95,7 +103,7 @@ jobs:
id: add_email_to_pluginfo
run: |
echo "The PR author email is ${{ steps.getemail.outputs.email }}"
echo "PLUGIN_INFO="$(<<<$PLUGIN_INFO jq '. + {author_email: "'${{ steps.getemail.outputs.email }}'"}')"" >> $GITHUB_OUTPUT
echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO tr -d "'" | jq -c '. + {author_email: "${{ steps.getemail.outputs.email }}"}')" >> $GITHUB_OUTPUT
runscore:
Expand All @@ -111,12 +119,13 @@ jobs:
steps:
- name: Add public, competition, and model_type to PLUGIN_INFO
run: |
echo "PLUGIN_INFO="$(<<<$PLUGIN_INFO jq '. + {domain: "language", public: "True", competition: "None", model_type: "artificialsubject"}')"" >> $GITHUB_ENV
echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO tr -d "'" | jq -c '. + {domain: "language", public: true, competition: "None", model_type: "artificialsubject"}')" >> $GITHUB_ENV
- name: Check out repository code
uses: actions/checkout@v2

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

0 comments on commit b85a28f

Please sign in to comment.