mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-11-22 21:20:41 +08:00
65 lines
1.6 KiB
YAML
65 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
|