ci-build #144
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
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.6 - PyTorch 1.0.0 | |
python-version: "3.6" | |
pytorch-version: torch==1.0.0 -f https://download.pytorch.org/whl/cpu/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@v4 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-ci | |
fail_ci_if_error: false |