2022-02-02 19:48:15 +00:00
|
|
|
name: Code check
|
2021-07-12 18:28:35 +00:00
|
|
|
|
2022-09-08 13:29:28 +00:00
|
|
|
on:
|
2021-07-12 18:28:35 +00:00
|
|
|
push:
|
|
|
|
branches: [master, "release/*"]
|
|
|
|
pull_request:
|
|
|
|
branches: [master, "release/*"]
|
|
|
|
|
2022-02-02 19:48:15 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
|
|
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
|
|
|
2021-07-12 18:28:35 +00:00
|
|
|
jobs:
|
2021-11-10 16:59:10 +00:00
|
|
|
mypy:
|
2021-07-12 18:28:35 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-07-11 21:46:52 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-08-01 16:59:48 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2022-03-11 09:20:47 +00:00
|
|
|
with:
|
2022-10-13 14:46:40 +00:00
|
|
|
python-version: '3.10.6'
|
2022-03-11 09:20:47 +00:00
|
|
|
|
|
|
|
# Note: This uses an internal pip API and may not always work
|
|
|
|
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
|
|
|
- name: Cache pip
|
2022-07-14 20:12:56 +00:00
|
|
|
uses: actions/cache@v3
|
2022-03-11 09:20:47 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
2022-06-21 15:11:33 +00:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pytorch/base.txt') }}
|
2022-03-11 09:20:47 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-10-21 07:15:33 +00:00
|
|
|
pip install mypy==0.971
|
2022-08-08 08:06:41 +00:00
|
|
|
pip install torch==1.12 --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
2022-06-21 15:11:33 +00:00
|
|
|
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt
|
2022-08-08 06:15:54 +00:00
|
|
|
# todo: adjust requirements for both code-bases
|
2022-10-13 14:46:40 +00:00
|
|
|
pip install -r requirements/pytorch/devel.txt -r requirements/app/devel.txt -r requirements/lite/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
2022-03-11 09:20:47 +00:00
|
|
|
pip list
|
|
|
|
|
2022-07-11 21:46:52 +00:00
|
|
|
- name: Check typing
|
2022-10-13 14:46:40 +00:00
|
|
|
run: |
|
|
|
|
mkdir .mypy_cache
|
|
|
|
mypy
|