45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Python Lint with Ruff
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- develop
|
|
paths:
|
|
- 'src/**'
|
|
- 'tests/**'
|
|
- 'pyproject.toml'
|
|
- 'ruff.toml'
|
|
- 'requirements.txt'
|
|
- 'requirements-dev.txt'
|
|
|
|
jobs:
|
|
python-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install dependencies
|
|
id: installDependencies
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: pull_request message with Ruff Lint results
|
|
id: prMessageRuffLint
|
|
run: |
|
|
echo 'echo ${{ toJson(github.event_name) }}'
|
|
echo 'echo ${{ toJson(github.event) }}'
|
|
curl -v -X POST \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
|
-d "{\"body\": \"## :mag: Ruff Lint Results\n\`\`\`\ntest\n\`\`\`\"}" \
|
|
${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/issues/8/comments
|