Sensitivity analysis #79
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: Linting with ruff # settings are in pyproject.toml | |
on: | |
pull_request: # only run on pull requests for now | |
branches: [ "master", "development" ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./dgl_ptm | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Get changed python files in dgl_ptm # for now, we only lint the changed files | |
id: files | |
run: | | |
echo "files=$(git diff --name-only --relative --diff-filter=d origin/$GITHUB_BASE_REF...origin/$GITHUB_HEAD_REF -- "*.py" | tr '\n' ' ')" >> $GITHUB_ENV | |
- name: Install dependencies # ruff tools are installed in the dev dependencies | |
if: env.files != '' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[dev] | |
- name: Check code style against standards | |
if: env.files != '' | |
run: | | |
ruff check $(echo ${{ env.files }} | tr ' ' '\n') | |
- name: Print message when files is empty | |
if: env.files == '' | |
run: echo "No python files were changed." |