Skip to content

Commit

Permalink
Update CI (#92)
Browse files Browse the repository at this point in the history
* Update CI

* Make Python version a string

* Run weekly
  • Loading branch information
davidtvs authored Jan 20, 2024
1 parent acc5e7e commit 98f7a89
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: ci-build

on:
schedule:
# At 00:00 on Saturday
- cron: '0 0 * * 6'
push:
branches: [master]
pull_request:
Expand All @@ -9,38 +12,41 @@ on:
jobs:
ci-build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5]
pytorch-version: [0.4.1, 1.5.0]
include:
- python-version: 3.7
pytorch-version: 0.4.1
- python-version: 3.8
pytorch-version: 1.5.0
- 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@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Caching dependencies
uses: actions/cache@v2
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 with PyTorch ${{ matrix.pytorch-version }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/torch_stable.html
pip install ${{ matrix.pytorch-version }}
pip install -e .[tests]
- name: Lint with flake8
Expand All @@ -54,7 +60,7 @@ jobs:
pytest --cov=torch_lr_finder --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
Expand Down

0 comments on commit 98f7a89

Please sign in to comment.