Skip to content

Commit

Permalink
Update CI configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
kadirnar committed Nov 24, 2023
1 parent b39046e commit a02a6fd
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 89 deletions.
46 changes: 18 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
name: Python package CI

name: Continuous Integration
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- '**.ipynb'

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

jobs:
build:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11"]
torch-version: ["2.0.0", "2.0.1", "2.1.1"]
python-version: [3.8, 3.9, '3.10', '3.11']
fail-fast: false

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 All @@ -52,22 +57,7 @@ jobs:
- name: Update pip
run: python -m pip install --upgrade pip

- name: Install PyTorch on Linux and Windows
if: >
matrix.operating-system == 'ubuntu-latest' ||
matrix.operating-system == 'windows-latest'
run: >
pip install torch==${{ matrix.torch-version }}
-f https://download.pytorch.org/whl/torch_stable.html
- name: Install PyTorch on MacOS
if: matrix.operating-system == 'macos-latest'
run: pip install torch==${{ matrix.torch-version }}

- name: Install whisperplus package from local setup.py
run: >
pip install -e .
- name: Unittest whisperplus
- name: Check styling with pre-commit
run: |
python -m unittest
pre-commit install
pre-commit run --all-files
106 changes: 45 additions & 61 deletions .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,59 @@
name: Package Testing
name: Package CI

on:
push:
branches: [ master ]
branches: [main]

pull_request:
branches: [ master ]
branches: [main]

jobs:
build:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11']
torch-version: ["2.0.0", "2.0.1", "2.1.0", "2.1.1"]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
fail-fast: false

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

- name: Set up Python
uses: actions/setup-python@v2
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 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 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: Update pip
run: python -m pip install --upgrade pip


- name: Install PyTorch on Linux and Windows
if: >
matrix.operating-system == 'ubuntu-latest' ||
matrix.operating-system == 'windows-latest'
run: >
pip install torch==${{ matrix.torch-version }}
-f https://download.pytorch.org/whl/torch_stable.html
- name: Install PyTorch on MacOS
if: matrix.operating-system == 'macos-latest'
run: pip install torch==${{ matrix.torch-version }}

- name: Install latest version of whisperplus
run: >
pip install --upgrade --force-reinstall whisperplus
- name: Unittest whisperplus
run: |
python -m unittest
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ 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@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@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: Check styling with pre-commit
run: |
pre-commit install
pre-commit run --all-files

0 comments on commit a02a6fd

Please sign in to comment.