action: Add workflow for github action to run check_guideline.py

Signed-off-by: Iulia Moldovan <iulia.moldovan@analog.com>
main
Iulia Moldovan 2022-06-28 10:22:53 +01:00 committed by imoldovan
parent 1014a0de78
commit 6113f3d70f
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
name: Guideline checker
on:
pull_request:
branches:
- master
paths:
- 'library/**'
- 'projects/**'
jobs:
guideline_check:
runs-on: ubuntu-latest
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
# version range
python-version: '3.x'
- name: Checkout repository code
uses: actions/checkout@v3
# repository that retrieves all the changed files
- name: Load get-changed-files repo
uses: Ana06/get-changed-files@v1.2
id: changed_files
with:
format: space-delimited
- name: Print changed files
run: |
echo "Changed files:"
echo "${{ steps.changed_files.outputs.all }}"
- name: Execute py script for guideline check
id: execution
# -p flag means that files will be specified with their relative path
run: |
python ./.github/scripts/check_guideline.py -p ${{ steps.changed_files.outputs.all }}
shell: sh