Package Testing #1041
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: Package Testing | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs at 00:00 UTC every day | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore Ubuntu cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'ubuntu-latest' | |
with: | |
path: ~/.cache/pip | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Restore MacOS cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'macos-latest' | |
with: | |
path: ~/Library/Caches/pip | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Restore Windows cache | |
uses: actions/cache@v1 | |
if: matrix.operating-system == 'windows-latest' | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}} | |
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}- | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
- name: Install latest labelme2coco package | |
run: > | |
pip install --upgrade --force-reinstall labelme2coco | |
- name: Test with unittest | |
run: | | |
pip install pytest | |
python -m unittest | |
- name: Test CLI | |
run: | | |
pip install . | |
labelme2coco tests/data/labelme_annot --train_split_rate 0.85 |