forked from SPARC-X/SPARC-X-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
670ab8b
commit 92bdcc5
Showing
1 changed file
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ jobs: | |
- name: Generate json api from github master | ||
run: | | ||
python -m sparc.docparser --git --include-subdirs | ||
- name: Env variable for api version | ||
run: | | ||
echo "API_VERSION=$(python -c "from sparc.api import SparcAPI; print(SparcAPI('parameters.json').sparc_version))" >> $GITHUB_ENV | ||
- name: Test if json api is newer than current | ||
id: probe | ||
run: | | ||
|
@@ -41,29 +44,30 @@ jobs: | |
- name: Create Pull Request | ||
if: steps.compare_versions.outputs.update_needed == 'true' | ||
run: | | ||
git checkout -b api_version | ||
mv parameters.json sparc/sparc_json_api/ | ||
gh pr create --title "[PR Bot] New JSON API version" -R alchem0x2a/SPARC-X-API | ||
- name: Create badges | ||
run: | | ||
mkdir -p badges/ | ||
# A coverage test badge | ||
anybadge --value=$COVPERCENT --file=badges/coverage.svg coverage | ||
# A version badge | ||
PIPVER=`pip show sparc-x-api | grep Version | cut -d ' ' -f2` | ||
anybadge --value=$PIPVER --file=badges/package.svg -l sparc-x-api | ||
- name: Manually add git badges | ||
run: | | ||
# Assuming a badges branch already exists! | ||
rm -rf /tmp/*.svg && cp badges/*.svg /tmp/ | ||
git fetch | ||
git switch badges || { echo "Could not check out badges branch. Have you created it on remote?"; exit 1; } | ||
git pull | ||
cp /tmp/*.svg badges/ && git add -f badges/*.svg && rm -rf /tmp/*.svg | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Action Bot (badges only)" | ||
git commit -m "Update badges from run ${RID}" || true | ||
git push -u origin badges || true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RID: ${{ github.run_id }} | ||
gh pr create -B master --title "[PR Bot] New JSON API version ${API_VERSION}" -R alchem0x2a/SPARC-X-API | ||
# - name: Create badges | ||
# run: | | ||
# mkdir -p badges/ | ||
# # A coverage test badge | ||
# anybadge --value=$COVPERCENT --file=badges/coverage.svg coverage | ||
# # A version badge | ||
# PIPVER=`pip show sparc-x-api | grep Version | cut -d ' ' -f2` | ||
# anybadge --value=$PIPVER --file=badges/package.svg -l sparc-x-api | ||
# - name: Manually add git badges | ||
# run: | | ||
# # Assuming a badges branch already exists! | ||
# rm -rf /tmp/*.svg && cp badges/*.svg /tmp/ | ||
# git fetch | ||
# git switch badges || { echo "Could not check out badges branch. Have you created it on remote?"; exit 1; } | ||
# git pull | ||
# cp /tmp/*.svg badges/ && git add -f badges/*.svg && rm -rf /tmp/*.svg | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "Github Action Bot (badges only)" | ||
# git commit -m "Update badges from run ${RID}" || true | ||
# git push -u origin badges || true | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# RID: ${{ github.run_id }} | ||
|