mirror of
https://github.com/public-apis/public-apis.git
synced 2025-07-31 15:20:27 +02:00
Create new workflow to run test of push and pull
This commit is contained in:
parent
bc02fa517f
commit
9bb225ef3d
3 changed files with 90 additions and 29 deletions
29
.github/workflows/test.yml
vendored
29
.github/workflows/test.yml
vendored
|
@ -1,29 +0,0 @@
|
|||
name: "Run tests"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
FORMAT_FILE: README.md
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: 'Validate README.md'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Validate Markdown format
|
||||
run: build/validate_format.py ${FORMAT_FILE}
|
||||
|
||||
- name: Validate pull request changes
|
||||
run: build/github-pull.sh ${{ github.repository }} ${{ github.event.pull_request.number }} ${FORMAT_FILE}
|
||||
if: github.event_name == 'pull_request'
|
33
.github/workflows/test_of_push_and_pull.yml
vendored
Normal file
33
.github/workflows/test_of_push_and_pull.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: "Tests of push & pull"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
FILENAME: README.md
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: 'Validate README.md'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Install dependencies
|
||||
run: python -m pip install -r scripts/requirements.txt
|
||||
|
||||
- name: Validate Markdown format
|
||||
run: python scripts/validate/format.py ${FILENAME}
|
||||
|
||||
- name: Validate pull request changes
|
||||
run: scripts/github_pull_request.sh ${{ github.repository }} ${{ github.event.pull_request.number }} ${FILENAME}
|
||||
if: github.event_name == 'pull_request'
|
Loading…
Add table
Add a link
Reference in a new issue