1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-05 20:22:25 +08:00
NeoNetwork/.github/workflows/test-your-pr.yml
Jerry be720938c2
test-your-pr: fix bot comment: fail on failure [skip ci]
Signed-off-by: Jerry <isjerryxiao@outlook.com>
2023-12-05 19:14:28 +08:00

67 lines
1.6 KiB
YAML

name: Test Your PR
on:
pull_request:
branches: [master]
jobs:
build:
name: Generate ROA
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
with:
repository: NeoCloud/NeoNetwork-ROA
path: generated
- uses: actions/setup-python@v2
with:
python-version: 3.x
architecture: x64
- shell: bash
run: |
env PYTHONUNBUFFERED=1 pip install -r scripts/requirements.txt 2> >(tee -a ~/buildjob.log >&2)
- shell: bash
run: |
env PYTHONUNBUFFERED=1 scripts/generate-roa.sh 2> >(tee -a ~/buildjob.log >&2)
- run: git -C generated diff README.md
- uses: actions/upload-artifact@v2
with:
name: generated
path: generated
comment_success:
needs: [build]
runs-on: ubuntu-20.04
if: ${{ always() && contains(needs.build.result, 'success') }}
steps:
- uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.COMMENT_GITHUB_TOKEN }}
message: |
Congratulations! Your pull request passed the check.
comment_failure:
needs: [build]
runs-on: ubuntu-20.04
if: ${{ always() && contains(needs.build.result, 'failure') }}
steps:
- shell: bash
run: |
tail ~/buildjob.log > ~/buildjob_tail.log
- uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.COMMENT_GITHUB_TOKEN }}
filePath: ~/buildjob_tail.log
- run: false