Speculator training code refresh #290
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies and run MyPy | |
name: MyPy Type Checking | |
on: [pull_request] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
id: setup_python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Restore Virtualenv | |
uses: actions/cache/restore@v4 | |
id: cache-venv-restore | |
with: | |
path: ./.venv/ | |
key: ${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-venv-${{ hashFiles('*requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-venv- | |
- name: Install dependencies | |
run: | | |
# Create the virtual environment | |
python -m venv .venv | |
. ./.venv/bin/activate | |
# Install the dependencies | |
# In case of a cache hit on the primary key, this will be a no-op | |
# In case of a cache miss, but hit on a secondary key, this will update what's changed | |
python -m pip install --upgrade pip | |
pip install -r test-requirements.txt | |
# Enables the virtual env for following steps | |
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
- name: Test with mypy | |
run: | | |
# Install ibm-fms from the main branch for testing purposes | |
# Use -I to ignore the existing install and actually install | |
# the version on main | |
pip install -I ibm-fms@git+https://github.com/foundation-model-stack/foundation-model-stack@main | |
# No type stubs available for "fire" and "transformers" | |
mypy --exclude fms_to_hf.py --exclude main_training.py --exclude setup.py . | |
- name: Save Virtualenv | |
id: cache-venv-save | |
uses: actions/cache/save@v4 | |
with: | |
path: ./.venv/ | |
key: ${{ steps.cache-venv-restore.outputs.cache-primary-key }} |