mirror of
https://github.com/RosettaCommons/foundry.git
synced 2026-06-04 13:24:22 +08:00
* Added more explanation and fixed small issues in demo commands in RFD3 README * fix github actions grepping ruff --------- Co-authored-by: Rohith Krishna <rohith@localhost>
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
name: lint_trunk
|
|
|
|
on:
|
|
push:
|
|
branches: [main, trunk, wip/for-release, wip/remove-chemdata]
|
|
pull_request:
|
|
branches: [main, trunk, wip/for-release, wip/remove-chemdata]
|
|
pull_request_target:
|
|
types: [ready_for_review]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: ruff (check code style)
|
|
# NOTE: We use an ubuntu runner to not be dependent on possibly limited digs infra
|
|
# for this tiny linting job. This means we can have many lint jobs accross repos in parallel.
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: 'pip'
|
|
- name: Extract ruff version from requirements.txt
|
|
run: |
|
|
echo "RUFF_VERSION=$(grep 'ruff==' pyproject.toml | sed 's/.*ruff==\(.*\)/\1/')" >> $GITHUB_ENV
|
|
- name: Install ruff
|
|
run: pip install ruff==${{ env.RUFF_VERSION }}
|
|
- name: Ruff format
|
|
run: ruff format --diff src tests scripts notebooks
|
|
- name: Ruff check
|
|
run: ruff check src tests scripts notebooks |