Skip to content

Convert pytorchbearer/torchbearer to GitHub Actions #14

Convert pytorchbearer/torchbearer to GitHub Actions

Convert pytorchbearer/torchbearer to GitHub Actions #14

Workflow file for this run

name: pytorchbearer/torchbearer
on:
push:
branches:
- "**/*"
pull_request:
concurrency:
# # This item has no matching transformer
# maximum_number_of_builds: 0
group: "${{ github.ref }}"
cancel-in-progress: true
jobs:
test_14:
runs-on: ubuntu-latest
env:
TORCH_URL: torch==1.3.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
TORCHVISION: torchvision==0.4.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
PILLOW: pillow<7.0.0
TORCH_VERSION: 1.3.0
steps:
- name: checkout
uses: actions/[email protected]
- name: Set up pip cache
uses: actions/[email protected]
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}"
restore-keys: "${{ runner.os }}-pip-"
- uses: actions/[email protected]
with:
python-version: '3.7.17'
- run: echo ${{ github.sha }}_RANGE
- run: 'if [ -z "${{ github.sha }}_RANGE"]; then COMMIT_RANGE="HEAD~..HEAD"; else COMMIT_RANGE=${{ github.sha }}_RANGE; fi;
'
- run: echo $COMMIT_RANGE
- run: |
if ! git diff --name-only $COMMIT_RANGE | grep -qE '^(torchbearer/|tests/|.travis.yml)'
then
echo "Only docs were updated, not running the CI."
exit
fi
- run: pip install -q coverage
- run: pip install -q nose
- run: pip install -q $TORCH_URL
- run: pip install future
- run: pip install $PILLOW
- run: pip install -q $TORCHVISION
- run: pip install -q -r requirements.txt
- run: nosetests tests -v --with-coverage --cover-package=torchbearer
- run: bash <(curl -s https://codecov.io/bash)
if: "${{ success() }}"
# # This item has no matching transformer
# - email:
# on_success: never
# on_failure: always
test_15:
runs-on: ubuntu-latest
env:
TORCH_URL: torch==1.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
TORCHVISION: torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
TORCH_VERSION: 1.4.0
PILLOW: pillow
steps:
- name: checkout
uses: actions/[email protected]
- name: Set up pip cache
uses: actions/[email protected]
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}"
restore-keys: "${{ runner.os }}-pip-"
- uses: actions/[email protected]
with:
python-version: '3.7.17'
- run: echo ${{ github.sha }}_RANGE
- run: 'if [ -z "${{ github.sha }}_RANGE"]; then COMMIT_RANGE="HEAD~..HEAD"; else COMMIT_RANGE=${{ github.sha }}_RANGE; fi;
'
- run: echo $COMMIT_RANGE
- run: |
if ! git diff --name-only $COMMIT_RANGE | grep -qE '^(torchbearer/|tests/|.travis.yml)'
then
echo "Only docs were updated, not running the CI."
exit
fi
- run: pip install -q coverage
- run: pip install -q nose
- run: pip install -q $TORCH_URL
- run: pip install future
- run: pip install $PILLOW
- run: pip install -q $TORCHVISION
- run: pip install -q -r requirements.txt
- run: nosetests tests -v --with-coverage --cover-package=torchbearer
- run: bash <(curl -s https://codecov.io/bash)
if: "${{ success() }}"
# # This item has no matching transformer
# - email:
# on_success: never
# on_failure: always