forked from foundation-model-stack/foundation-model-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.57 KB
/
mypy.yml
File metadata and controls
55 lines (45 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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.12
id: setup_python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- 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 pytest
run: |
mypy --exclude hf --exclude testing fms
- name: Save Virtualenv
id: cache-venv-save
uses: actions/cache/save@v4
with:
path: ./.venv/
key: ${{ steps.cache-venv-restore.outputs.cache-primary-key }}