Skip to content

ci-build

ci-build #17

Workflow file for this run

name: ci-build
on:
schedule:
# At 00:00 on Saturday
- cron: '0 0 * * 6'
push:
branches: [master]
pull_request:
branches: [master]
jobs:
ci-build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
include:
- label: Ubuntu 20.04 - Python 3.5 - PyTorch 0.4.1
python-version: "3.5"
pytorch-version: torch==0.4.1 -f https://download.pytorch.org/whl/torch_stable.html
os: ubuntu-20.04
- label: Ubuntu latest - Python 3.10 - PyTorch stable
python-version: "3.10"
pytorch-version: torch
os: ubuntu-latest
runs-on: ${{ matrix.os }}
name: ${{ matrix.label }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Caching dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py-${{ matrix.python-version }}-pytorch-${{ matrix.pytorch-version }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-py-${{ matrix.python-version }}-pytorch-${{ matrix.pytorch-version }}-pip-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.pytorch-version }}
pip install -e .[tests]
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run tests and generate coverage
run: |
pytest --cov=torch_lr_finder --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-ci
fail_ci_if_error: false