update ci-testing.yml with on: cron (#572)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
1 parent
a91cdd2ead
commit
5414e53026
3 files changed
+87
-84
No files matched your search
@@ -1,7 +1,10 @@
|
||||
name: CI CPU testing
|
||||
|
||||
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
||||
on: [push, pull_request]
|
||||
on: # https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
cpu-tests:
|
||||
@@ -17,56 +20,56 @@ jobs:
|
||||
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
||||
timeout-minutes: 50
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
# Note: This uses an internal pip API and may not always work
|
||||
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
||||
- name: Get pip cache
|
||||
id: pip-cache
|
||||
run: |
|
||||
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
||||
# Note: This uses an internal pip API and may not always work
|
||||
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
||||
- name: Get pip cache
|
||||
id: pip-cache
|
||||
run: |
|
||||
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.python-version }}-pip-
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.python-version }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
||||
pip install -q onnx
|
||||
python --version
|
||||
pip --version
|
||||
pip list
|
||||
shell: bash
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
||||
pip install -q onnx
|
||||
python --version
|
||||
pip --version
|
||||
pip list
|
||||
shell: bash
|
||||
|
||||
- name: Download data
|
||||
run: |
|
||||
python -c "from utils.google_utils import * ; gdrive_download('1n_oKgR81BJtqk75b00eAjdv03qVCQn2f', 'coco128.zip')"
|
||||
mv ./coco128 ../
|
||||
- name: Download data
|
||||
run: |
|
||||
python -c "from utils.google_utils import * ; gdrive_download('1n_oKgR81BJtqk75b00eAjdv03qVCQn2f', 'coco128.zip')"
|
||||
mv ./coco128 ../
|
||||
|
||||
- name: Tests workflow
|
||||
run: |
|
||||
export PYTHONPATH="$PWD" # to run *.py. files in subdirectories
|
||||
di=cpu # inference devices # define device
|
||||
|
||||
# train
|
||||
python train.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --cfg models/${{ matrix.model }}.yaml --epochs 1 --device $di
|
||||
# detect
|
||||
python detect.py --weights weights/${{ matrix.model }}.pt --device $di
|
||||
python detect.py --weights runs/exp0/weights/last.pt --device $di
|
||||
# test
|
||||
python test.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --device $di
|
||||
python test.py --img 256 --batch 8 --weights runs/exp0/weights/last.pt --device $di
|
||||
|
||||
python models/yolo.py --cfg models/${{ matrix.model }}.yaml # inspect
|
||||
python models/export.py --img 256 --batch 1 --weights weights/${{ matrix.model }}.pt # export
|
||||
shell: bash
|
||||
- name: Tests workflow
|
||||
run: |
|
||||
export PYTHONPATH="$PWD" # to run *.py. files in subdirectories
|
||||
di=cpu # inference devices # define device
|
||||
|
||||
# train
|
||||
python train.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --cfg models/${{ matrix.model }}.yaml --epochs 1 --device $di
|
||||
# detect
|
||||
python detect.py --weights weights/${{ matrix.model }}.pt --device $di
|
||||
python detect.py --weights runs/exp0/weights/last.pt --device $di
|
||||
# test
|
||||
python test.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --device $di
|
||||
python test.py --img 256 --batch 8 --weights runs/exp0/weights/last.pt --device $di
|
||||
|
||||
python models/yolo.py --cfg models/${{ matrix.model }}.yaml # inspect
|
||||
python models/export.py --img 256 --batch 1 --weights weights/${{ matrix.model }}.pt # export
|
||||
shell: bash
|
||||
Reference in new issue
Block a user