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-11-03 07:29:20 +00:00
|
|
|
paths:
|
2023-06-15 15:25:59 +00:00
|
|
|
- ".actions/*"
|
2022-11-03 07:29:20 +00:00
|
|
|
- ".github/workflows/code-checks.yml"
|
|
|
|
- "requirements/**"
|
|
|
|
- "src/**"
|
2023-09-25 12:34:41 +00:00
|
|
|
- "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 }}
|
2023-12-21 22:49:18 +00:00
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
2022-02-02 19:48:15 +00:00
|
|
|
|
2022-11-01 00:44:58 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
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:
|
2023-10-03 19:42:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-09 13:33:09 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2023-09-25 12:34:41 +00:00
|
|
|
with:
|
2024-08-03 13:49:42 +00:00
|
|
|
python-version: "3.11"
|
2023-09-25 12:34:41 +00:00
|
|
|
|
|
|
|
- name: Mypy cache
|
2024-02-16 17:33:16 +00:00
|
|
|
uses: actions/cache@v4
|
2023-09-25 12:34:41 +00:00
|
|
|
with:
|
|
|
|
path: .mypy_cache
|
|
|
|
key: mypy-${{ hashFiles('requirements/typing.txt') }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
env:
|
|
|
|
FREEZE_REQUIREMENTS: 1
|
2023-10-03 18:40:43 +00:00
|
|
|
timeout-minutes: 20
|
2023-09-25 12:34:41 +00:00
|
|
|
run: |
|
2023-10-03 16:22:00 +00:00
|
|
|
pip install -e '.[pytorch-all,fabric-all]' -r requirements/typing.txt
|
2023-09-25 12:34:41 +00:00
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Check typing
|
2023-10-24 12:11:54 +00:00
|
|
|
run: mypy
|