lightning/.github/workflows/code-checks.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.0 KiB
YAML
Raw Normal View History

2022-02-02 19:48:15 +00:00
name: Code check
2021-07-12 18:28:35 +00:00
on:
2021-07-12 18:28:35 +00:00
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
2022-11-26 01:16:48 +00:00
- ".actions/**"
- ".github/workflows/code-checks.yml"
- "requirements/**"
- "src/**"
- "pyproject.toml" # includes mypy config
2022-11-26 01:16:48 +00:00
- "!requirements/docs.txt"
- "!requirements/*/docs.txt"
2022-11-16 10:07:02 +00:00
- "!*.md"
- "!**/*.md"
2021-07-12 18:28:35 +00:00
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/')) }}
2022-11-01 00:44:58 +00:00
defaults:
run:
shell: bash
2021-07-12 18:28:35 +00:00
jobs:
2022-11-01 00:44:58 +00:00
mypy:
2021-07-12 18:28:35 +00:00
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.6'
# 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
2023-02-02 10:36:33 +00:00
key: pip-${{ hashFiles('requirements/pytorch/base.txt') }}
restore-keys: pip-
enableCrossOsArchive: true
- name: Install dependencies
run: |
2022-11-01 00:44:58 +00:00
pip install mypy==0.982 # TODO: pull this verion deom requirements/test.txt
2022-08-08 08:06:41 +00:00
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/fabric/base.txt \
2022-11-01 00:44:58 +00:00
-r requirements/pytorch/base.txt \
-r requirements/pytorch/extra.txt \
-r requirements/app/base.txt \
-r requirements/app/cloud.txt \
-r requirements/app/ui.txt \
--find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
- name: Build package
run: python setup.py build
- name: Check typing
run: |
mkdir .mypy_cache
mypy