-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
92 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Run unit tests | ||
on: | ||
push: [ master ] | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ignite | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.8] | ||
pytorch-channel: [pytorch, pytorch-nightly] | ||
include: | ||
# includes a single build on windows | ||
- os: windows-latest | ||
pytorch-channel: pytorch | ||
python-version: 3.7 | ||
skip-distrib-tests: 1 | ||
# includes a single build on macosx | ||
- os: macos-latest | ||
pytorch-channel: pytorch | ||
python-version: 3.7 | ||
skip-distrib-tests: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: git clone https://github.com/pytorch/ignite | ||
|
||
- name: Get year & week number | ||
id: get-date | ||
run: | | ||
echo "::set-output name=date::$(/bin/date "+%Y-%U")" | ||
shell: bash -l {0} | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
pip3 install -U --user pip | ||
echo "::set-output name=dir::$(pip3 cache dir)" | ||
shell: bash -l {0} | ||
|
||
- 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') }} | ||
restore-keys: | | ||
${{ steps.get-date.outputs.date }}-pytorch-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}- | ||
- 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! | ||
|
||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }} | ||
pip install -r requirements-dev.txt | ||
python setup.py install | ||
- name: Check code formatting | ||
shell: bash -l {0} | ||
run: | | ||
pip install flake8 "black==19.10b0" "isort==5.7.0" | ||
flake8 ignite/ tests/ examples/ | ||
black --check . | ||
isort -c --profile black . | ||
- name: Run Mypy | ||
shell: bash -l {0} | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
pip install mypy | ||
mypy --config-file mypy.ini | ||
- name: Run Tests | ||
shell: bash -l {0} | ||
run: | | ||
SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./coverage.xml |
This file was deleted.
Oops, something went wrong.