pytorch/.github/workflows/test_tools.yml
Nikita Shulga bc608b6e16 Add gitutils tests (#71580)
Summary:
Test PeekableIterator behavior

Add `.github/scripts/test_*.py` to list of tests run by test_tools
workflow and pin Python version to 3.7 in test_tools workflow

Change PeekableIterator inheritance from collections.abc.Iterator, to
typing.Iterator, which is a correct alias starting from Python-3.7

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71580

Reviewed By: bigfootjon

Differential Revision: D33690659

Pulled By: malfet

fbshipit-source-id: 71f270b15138230772e2eed0da66cdfcb34825cc
(cherry picked from commit 42abb07396fa90272afb0b56508bd3a1f5c4ccbe)
2022-01-20 14:33:41 -08:00

38 lines
1.1 KiB
YAML

name: Test tools
on:
push:
branches:
- master
pull_request:
jobs:
test:
if: ${{ github.repository == 'pytorch/pytorch' }}
runs-on: ubuntu-18.04
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Checkout PyTorch
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
with:
fetch-depth: 0 # deep clone, to allow us to use git log
- name: Install dependencies
# mypy and boto3 versions copied from
# .circleci/docker/common/install_conda.sh
run: |
set -eux
python3 -mpip install -r requirements.txt
python3 -mpip install boto3==1.16.34
make setup_lint
- name: Test tools
run: |
python3 -m unittest discover -vs tools/test -p 'test_*.py'
python3 -m unittest discover -vs .github/scripts -p 'test_*.py'
concurrency:
group: test-tools-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true