Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Workflow for Linting , Formatting and Test. Activate Workflow for Framework #7

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright The FMS HF Tuning Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Format

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
plugin_name:
- "framework"
# - "accelerated-peft" # enable later

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run linter
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e lint
- name: Run formatter
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e fmt
- name: Run pytest
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e py
8 changes: 8 additions & 0 deletions plugins/accelerated-peft/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ commands =

[testenv:lint]
description = run linters
deps =
pylint>=2.16.2,<=3.1.0
commands = pylint src tests
allowlist_externals = pylint

[testenv:fmt]
description = format
skip_install = true
deps =
black>=22.12
Expand All @@ -26,6 +33,7 @@ commands =
black {posargs:.}
isort {posargs:.}


# [testenv:build]
# description = build wheel
# deps =
Expand Down
Loading
Loading