Skip to content

Commit

Permalink
Build Wheel Action
Browse files Browse the repository at this point in the history
Signed-off-by: James Busche <jbusche@us.ibm.com>
  • Loading branch information
jbusche committed Apr 2, 2024
1 parent 3785363 commit 9847340
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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: Build FMS-hf-tuning Library

on:
push:
branches: ["main", "release-*"]
pull_request:
branches: ["main", "release-*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 -r setup_requirements.txt
- name: Build and test with tox
run: tox -e py39
40 changes: 40 additions & 0 deletions .github/workflows/publish-library.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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: Publish FMS-hf-tuning Library

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Build and check package
run: |
python -m pip install --upgrade pip
pip install tox
tox -e build,twinecheck
# Work in progress... need to get a PYPI_TOKEN in the repo
# - name: Upload package
# if: github.event_name == 'release'
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_TOKEN }}
3 changes: 2 additions & 1 deletion setup_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pre-commit>=3.0.4,<4.0
pylint>=2.16.2,<4.0
pydeps>=1.12.12,<2
tox>=4.4.2,<5
tox>=4.4.2,<5
build>=0.10.0,<2.0
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description = run unit tests
deps =
pytest>=7
-r requirements.txt
wheel>=0.38.4
commands =
pytest {posargs:tests}

Expand All @@ -20,3 +21,17 @@ deps = pylint>=2.16.2,<=3.1.0
-r requirements.txt
commands = pylint tuning scripts/*.py build/*.py
allowlist_externals = pylint

[testenv:build]
description = build wheel
deps =
build
commands = python -m build
skip_install = True

[testenv:twinecheck]
description = check wheel
deps =
twine
commands = twine check dist/*
skip_install = True

0 comments on commit 9847340

Please sign in to comment.