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

Update GitHub Actions workflows #16

Merged
merged 1 commit into from
Nov 23, 2023
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
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ name: Python package CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- '**.ipynb'

pull_request:
branches: [main]
paths-ignore:
- '**.md'
- '**.ipynb'

jobs:
build:
Expand All @@ -18,31 +25,31 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Restore Ubuntu cache
uses: actions/cache@v2
uses: actions/cache@v3
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore MacOS cache
uses: actions/cache@v2
uses: actions/cache@v3
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore Windows cache
uses: actions/cache@v2
uses: actions/cache@v3
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
Expand Down
67 changes: 34 additions & 33 deletions .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,50 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, 3.10, 3.11]
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
torch-version: [2.1.0, 2.1.1]
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Restore Ubuntu cache
uses: actions/cache@v2
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-
- name: Restore Ubuntu cache
uses: actions/cache@v3
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore MacOS cache
uses: actions/cache@v2
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-
- name: Restore MacOS cache
uses: actions/cache@v3
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore Windows cache
uses: actions/cache@v2
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-
- name: Restore Windows cache
uses: actions/cache@v3
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Update pip
run: python -m pip install --upgrade pip
- name: Update pip
run: python -m pip install --upgrade pip

- name: Install Numpy
run: >
pip install numpy
- name: Check styling with pre-commit
run: |
pre-commit install
pre-commit run --all-files

- name: Install PyTorch on Linux and Windows
if: >
Expand Down
47 changes: 20 additions & 27 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
name: Publish Python distributions to PyPI
name: Publish Python Package

on:
push:
branches: [ master ]
release:
types: [created]

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
deploy:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_WHISPERPLUS_API_KEY }}
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_WHISPERPLUS_API_KEY }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*