-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
49 changed files
with
1,117 additions
and
531 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Universum check | ||
on: push | ||
|
||
jobs: | ||
universum_check: | ||
name: Universum check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependency | ||
run: pip install universum[test] | ||
|
||
- name: Universum | ||
run: | ||
python -u -m universum | ||
--fail-unsuccessful | ||
--vcs-type=git | ||
--git-repo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | ||
--git-refspec $GITHUB_REF_NAME | ||
--no-archive | ||
--no-diff | ||
|
||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
files: artifacts/*.xml | ||
|
||
- name: Collect artifacts | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: artifacts | ||
path: artifacts |
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Telegram bot | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, closed] | ||
issue_comment: | ||
types: [created] | ||
workflow_run: | ||
workflows: [Universum check] | ||
types: [completed] | ||
pull_request_review: | ||
types: [submitted, edited, dismissed] | ||
|
||
jobs: | ||
make-comment: | ||
name: Send comment to TG | ||
runs-on: ubuntu-latest | ||
env: | ||
PR_AUTHOR: ${{ github.event.pull_request.user.login }} | ||
PR_NAME: ${{ github.event.pull_request.title }} | ||
PR_BASE: ${{ github.event.pull_request.base.ref }} | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
PR_MERGED: ${{ github.event.pull_request.merged_by.login }} | ||
REVIEW_STATE: ${{ github.event.review.state }} | ||
REVIEW_AUTHOR: ${{ github.event.review.user.login }} | ||
REVIEW_COMMENT: ${{ github.event.review.body }} | ||
COMMENT_AUTHOR: ${{ github.event.comment.user.login }} | ||
COMMENT_URL: ${{ github.event.comment.html_url }} | ||
COMMENT_BODY: ${{ github.event.comment.body }} | ||
COMMENT_NUMBER: ${{ github.event.issue.number }} | ||
UNIVERUM_COMMIT: ${{ github.event.workflow_run.head_sha }} | ||
UNIVERSUM_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
UNIVERSUM_LOG: ${{ github.event.workflow_run.html_url }} | ||
|
||
steps: | ||
- name: Send message to TG | ||
run: | | ||
if [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "opened" ]]; then | ||
ESCAPED_NAME=`echo -e "${{ env.PR_NAME }}" | sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g'` | ||
TEXT=`echo -e "<b>${{ env.PR_AUTHOR }}</b> created new <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a> '$ESCAPED_NAME' to branch '${{ env.PR_BASE }}'"` | ||
elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "synchronize" ]]; then | ||
TEXT=`echo -e "<b>${{ env.PR_AUTHOR }}</b> updated <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>"` | ||
elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then | ||
TEXT=`echo -e "<b>${{ env.PR_MERGED }}</b> merged <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a> to branch <b>'${{ env.PR_BASE }}'</b>"` | ||
elif [[ ! -z "${{ github.event.pull_request }}" && "${{ github.event.action }}" == "closed" ]]; then | ||
TEXT=`echo -e "<b>${{ env.PR_AUTHOR }}</b> closed <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>"` | ||
elif [[ ! -z "${{ github.event.comment }}" ]]; then | ||
ESCAPED_TEXT=`echo -e "${{ env.COMMENT_BODY }}"| sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g'` | ||
TEXT=`echo -e "<b>${{ env.COMMENT_AUTHOR }}</b> posted the following comment to issue <a href=\"${{ env.COMMENT_URL }}\">#${{ env.COMMENT_NUMBER }}</a>:\n<i>$ESCAPED_TEXT</i>"` | ||
elif [[ ! -z "${{ github.event.review }}" && "${{ env.REVIEW_STATE }}" == "changes_requested" ]]; then | ||
TEXT=`echo -e "<b>${{ env.REVIEW_AUTHOR }}</b> requested changes for <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>"` | ||
elif [[ ! -z "${{ github.event.review }}" && "${{ env.REVIEW_STATE }}" == "commented" ]]; then | ||
ESCAPED_TEXT=`echo -e "${{ env.REVIEW_COMMENT }}"| sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g'` | ||
TEXT=`echo -e "<b>${{ env.REVIEW_AUTHOR }}</b> posted the following comment to <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>:\n<i>$ESCAPED_TEXT</i>"` | ||
elif [[ ! -z "${{ github.event.review }}" ]]; then | ||
TEXT=`echo -e "<b>${{ env.REVIEW_AUTHOR }}</b> ${{ env.REVIEW_STATE }} <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>"` | ||
elif [[ -z "${{ github.event.review }}" && "${{ github.event.action }}" == "submitted" ]]; then | ||
TEXT=`echo -e "Due to GitHub Actions bug we cannot identify, who approved <a href=\"${{ env.PR_URL }}\">PR#${{ env.PR_NUMBER }}</a>"` | ||
elif [[ ! -z "${{ github.event.workflow_run }}" && "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then | ||
TEXT=`echo -e "<a href=\"${{ env.UNIVERSUM_LOG }}\">Universum run for branch '${{ env.UNIVERSUM_BRANCH }}'</a> <b>SUCCEDED</b>; commit ${{ env.UNIVERUM_COMMIT }} "` | ||
elif [[ ! -z "${{ github.event.workflow_run }}" && "${{ github.event.workflow_run.conclusion }}" == "failure" ]]; then | ||
TEXT=`echo -e "<a href=\"${{ env.UNIVERSUM_LOG }}\">Universum run for branch '${{ env.UNIVERSUM_BRANCH }}'</a> <b>FAILED</b>; commit ${{ env.UNIVERUM_COMMIT }} "` | ||
fi | ||
if [[ ! -z $TEXT ]]; then | ||
curl --get --data-urlencode "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --data-urlencode "disable_web_page_preview=True" \ | ||
--data-urlencode "text=$TEXT" --data-urlencode "parse_mode=HTML" $URL | ||
fi | ||
env: | ||
URL: https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage |
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
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
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
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
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
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
Oops, something went wrong.