43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Code check
|
|
|
|
on:
|
|
push:
|
|
branches: [master, "release/*"]
|
|
pull_request:
|
|
branches: [master, "release/*"]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
|
|
jobs:
|
|
mypy:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.9
|
|
|
|
# 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
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pytorch/base.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install torch==1.12 --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
|
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt
|
|
# todo: adjust requirements for both code-bases
|
|
pip install -r requirements/pytorch/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
|
|
pip list
|
|
|
|
- name: Check typing
|
|
run: mypy
|