From 3c032e84c9e9e1c3e2500a5a8c3b5b6bd6ca3a8c Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 5 Jul 2020 15:53:22 +0300 Subject: [PATCH] Add CI to run examples via github action --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..fd84b7f1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: Run Examples + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install PyTorch + run: | + python -m pip install --upgrade pip + # Install CPU-based pytorch + pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html + # Maybe use the CUDA 10.2 version instead? + # pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html + - name: Run Tests + run: | + ./run_python_examples.sh "install_deps,run_all,clean" + + diff --git a/README.md b/README.md index ef2ad05b..05b1e985 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # PyTorch Examples +![github CI](https://github.com/pytorch/pytorch-examples/workflows/.github/workflows/main.yml/badge.svg) A repository showcasing examples of using [PyTorch](https://github.com/pytorch/pytorch)