Skip to content

Commit

Permalink
ci: migrate to pip from miniconda, fix pytorch#2199 (pytorch#2201)
Browse files Browse the repository at this point in the history
* ci: migrate to pip from miniconda, fix pytorch#2199

* fix: test torch 1.9.1

* Update test_auto.py

Co-authored-by: vfdev <[email protected]>
  • Loading branch information
ydcjeff and vfdev-5 authored Sep 28, 2021
1 parent 3e07897 commit 6f5f740
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get year & week number
id: get-date
Expand All @@ -52,41 +55,38 @@ jobs:
- name: Get pip cache dir
id: pip-cache
run: |
python3 -m pip install -U pip
echo "::set-output name=dir::$(python3 -m pip cache dir)"
shell: bash -l {0}
pip install -U pip
echo "::set-output name=dir::$(pip cache dir)"
- uses: actions/cache@v2
with:
path: |
~/conda_pkgs_dir
${{ steps.pip-cache.outputs.dir }}
key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ hashFiles('requirements-dev.txt') }}
key: ${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-channel }}-
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- run: pip install pip wheel setuptools -Uqq

- name: Install PyTorch
if: ${{ matrix.pytorch-channel == 'pytorch' }}
run: pip install torch torchvision -f https://download.pytorch.org/whl/cpu/torch_stable.html

- name: Install PyTorch (nightly)
if: ${{ matrix.pytorch-channel == 'pytorch-nightly' }}
run: pip install torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre

- name: Install dependencies
shell: bash -l {0}
run: |
conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} -c conda-forge
pip install -r requirements-dev.txt
pip install -r requirements-dev.txt -qq
python setup.py install
- name: Check code formatting
shell: bash -l {0}
run: |
bash ./tests/run_code_style.sh install
bash ./tests/run_code_style.sh lint
- name: Run Mypy
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
bash ./tests/run_code_style.sh mypy
Expand Down

0 comments on commit 6f5f740

Please sign in to comment.