Improve scripts and more (#3011)
This commit is contained in:
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'
|
||||
37
.github/workflows/test_of_push_and_pull.yml
vendored
Normal file
37
.github/workflows/test_of_push_and_pull.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: "Tests of push & pull"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
FILENAME: README.md
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: 'Validate README.md changes'
|
||||
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'
|
||||
|
||||
- name: Checking if push changes are duplicated
|
||||
run: python scripts/validate/links.py ${FILENAME} --only_duplicate_links_checker
|
||||
if: github.event_name == 'push'
|
||||
29
.github/workflows/test_of_validate_package.yml
vendored
Normal file
29
.github/workflows/test_of_validate_package.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: "Tests of validate package"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
unittest:
|
||||
name: 'Run tests of validate package'
|
||||
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: Run Unittest
|
||||
run: |
|
||||
cd scripts
|
||||
python -m unittest discover tests/ --verbose
|
||||
19
.github/workflows/validate_links.yml
vendored
19
.github/workflows/validate_links.yml
vendored
@@ -3,20 +3,25 @@ name: "Validate links"
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
FORMAT_FILE: README.md
|
||||
FILENAME: README.md
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: 'Validate links'
|
||||
validate_links:
|
||||
name: 'Check all links are working'
|
||||
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 all links from README.md
|
||||
run: build/validate_links.py ${FORMAT_FILE}
|
||||
run: python scripts/validate/links.py ${FILENAME}
|
||||
|
||||
Reference in New Issue
Block a user