Skip to content

import OpenEBench

import OpenEBench #119

name: openebench metrics import
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
import-openebench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: content
- uses: actions/checkout@v2
with:
repository: bio-tools/content-ecosystem-utils
path: content-ecosystem-utils
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: import openebench metrics via http endpoint
run: |
cd ${{ github.workspace }}/content/data
if ${{ github.workspace }}/content-ecosystem-utils/scripts/git-utils/checkout-pr-if-exist.sh openebench-import; then
IS_PR_CREATED=true
else
IS_PR_CREATED=false
fi
cd ${{ github.workspace }}/content-ecosystem-utils/scripts/openebench-import
pip install jsonpatch
OEB_IMPORT_DIFF="$(python openebench-import.py)"
OEB_IMPORT_FILES_ADDED=`echo $(jq -r '.add_files' <<< "$OEB_IMPORT_DIFF")`
OEB_IMPORT_OBJECTS_ADDED=`echo $(jq -r '.add_objects' <<< "$OEB_IMPORT_DIFF")`
OEB_IMPORT_OBJECTS_REMOVED=`echo $(jq -r '.remove_objects' <<< "$OEB_IMPORT_DIFF")`
OEB_IMPORT_DIFF=`echo $(jq -r '.diff' <<< "$OEB_IMPORT_DIFF")`
echo "OEB_IMPORT_FILES_ADDED=$OEB_IMPORT_FILES_ADDED" >> $GITHUB_ENV
echo "OEB_IMPORT_OBJECTS_ADDED=$OEB_IMPORT_OBJECTS_ADDED" >> $GITHUB_ENV
echo "OEB_IMPORT_OBJECTS_REMOVED=$OEB_IMPORT_OBJECTS_REMOVED" >> $GITHUB_ENV
echo "OEB_IMPORT_DIFF=$OEB_IMPORT_DIFF" >> $GITHUB_ENV
echo "IS_PR_CREATED=$IS_PR_CREATED" >> $GITHUB_ENV
- name: commit new data and push to PR
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ github.workspace }}/content/data
${{ github.workspace }}/content-ecosystem-utils/scripts/git-utils/import-changes.sh $IS_PR_CREATED openebench-import