Skip to content

Set up test configs to run tests in a container #62

Set up test configs to run tests in a container

Set up test configs to run tests in a container #62

Workflow file for this run

name: syntax
on:
pull_request:
branches:
- "**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.py
- name: Prepare python env
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: pip3 install -r requirements.devel.txt
- name: Run pylint
id: pylint
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
delimiter=$(openssl rand -hex 8)
echo "report<<$delimiter" >> $GITHUB_OUTPUT
pylint ${{ steps.changed-files.outputs.all_changed_files }} --exit-zero >> $GITHUB_OUTPUT
echo $delimiter >> $GITHUB_OUTPUT
- name: Post pylint output
uses: mshick/add-pr-comment@v2
if: ${{ steps.changed-files.outputs.all_changed_files }}
with:
message: |
<details>
<summary>pylint output</summary>
```
${{ steps.pylint.outputs.report }}
```
</details>
message-id: pylint-report
- name: Run black
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: black ${{ steps.changed-files.outputs.all_changed_files }} --check --diff --color
- name: Run isort
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: isort ${{ steps.changed-files.outputs.all_changed_files }} --diff --color --check-only