Fix types #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Checkstyle | |
on: | |
pull_request_target: | |
types: [labeled, opened, synchronize, reopened] | |
permissions: | |
contents: read | |
concurrency: | |
group: py-checkstyle-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
py-checkstyle: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Ubuntu related dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y libsasl2-dev unixodbc-dev python3-venv | |
- name: Install Python & Openmetadata related dependencies | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
make install_dev | |
- name: Code style check | |
id: style | |
continue-on-error: true | |
run: | | |
source venv/bin/activate | |
make lint py_format_check | |
- name: Create a comment in the PR with the instructions | |
if: steps.style.outcome != 'success' | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
**The Python checkstyle failed.** | |
Please run `make py_format` and `lint` in the root of your repository and commit the changes to this PR. | |
You can also use [pre-commit](https://pre-commit.com/) to automate the Python code formatting. | |
You can install the pre-commit hooks with `make install_test precommit_install`. | |
- name: Python checkstyle failed, check the comment in the PR | |
if: steps.style.outcome != 'success' | |
run: | | |
exit 1 |