From 0e579caedf2f646567a34b9a079663654411aa1a Mon Sep 17 00:00:00 2001 From: Simon Martens Date: Wed, 17 Jul 2024 18:52:01 +0200 Subject: [PATCH] Added github action to lint the files on upload --- .github/workflows/custom_linter.yml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/custom_linter.yml diff --git a/.github/workflows/custom_linter.yml b/.github/workflows/custom_linter.yml new file mode 100644 index 0000000..a874cf5 --- /dev/null +++ b/.github/workflows/custom_linter.yml @@ -0,0 +1,40 @@ +name: Custom XML Linter + +on: + push: + paths: + - 'XML/**/*.xml' + pull_request: + paths: + - 'XML/**/*.xml' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install lxml + + - name: Run custom linter + run: python Scripts/custom_linter.py + + - name: Process linter output + if: failure() + run: | + python Scripts/process_linter_output.py + + - name: Upload linter results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: linter-results + path: linter_results.txt