|
|
name: Wheel |
|
|
|
|
|
on: |
|
|
push: |
|
|
branches: |
|
|
- main |
|
|
|
|
|
jobs: |
|
|
|
|
|
build_wheels: |
|
|
name: Build on ${{ matrix.os }} |
|
|
runs-on: ${{ matrix.os }} |
|
|
strategy: |
|
|
fail-fast: false |
|
|
matrix: |
|
|
os: [ubuntu-latest, macos-latest] |
|
|
python-version: [3.8] |
|
|
|
|
|
steps: |
|
|
- name: Checkout code |
|
|
uses: nschloe/action-cached-lfs-checkout@v1.1.3 |
|
|
with: |
|
|
exclude: "scoutbot/*/models/pytorch/" |
|
|
|
|
|
- uses: actions/setup-python@v2 |
|
|
name: Install Python |
|
|
with: |
|
|
python-version: ${{ matrix.python-version }} |
|
|
|
|
|
- name: Build wheel |
|
|
run: | |
|
|
pip install --upgrade pip |
|
|
pip install build |
|
|
python -m build --wheel --outdir dist/ . |
|
|
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
with: |
|
|
path: ./dist/*.whl |
|
|
|
|
|
build_sdist: |
|
|
name: Build source distribution |
|
|
runs-on: ubuntu-latest |
|
|
steps: |
|
|
- name: Checkout code |
|
|
uses: nschloe/action-cached-lfs-checkout@v1.1.3 |
|
|
with: |
|
|
exclude: "scoutbot/*/models/pytorch/" |
|
|
|
|
|
- uses: actions/setup-python@v2 |
|
|
name: Install Python |
|
|
with: |
|
|
python-version: '3.8' |
|
|
|
|
|
- name: Build sdist |
|
|
run: | |
|
|
pip install --upgrade pip |
|
|
pip install build |
|
|
python -m build --sdist --outdir dist/ . |
|
|
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
with: |
|
|
path: ./dist/*.tar.gz |
|
|
|
|
|
test_wheel: |
|
|
needs: [build_wheels, build_sdist] |
|
|
runs-on: ubuntu-latest |
|
|
env: |
|
|
WIC_BATCH_SIZE: 16 |
|
|
|
|
|
|
|
|
if: github.event_name == 'push' |
|
|
steps: |
|
|
- uses: actions/setup-python@v2 |
|
|
name: Install Python |
|
|
with: |
|
|
python-version: '3.8' |
|
|
|
|
|
- uses: actions/download-artifact@v2 |
|
|
with: |
|
|
name: artifact |
|
|
path: dist |
|
|
|
|
|
- name: Install wheel |
|
|
run: | |
|
|
pip install --upgrade pip |
|
|
pip install wheel |
|
|
pip install dist/*.whl |
|
|
|
|
|
- name: Test module |
|
|
run: | |
|
|
python -c "import scoutbot; scoutbot.fetch(); scoutbot.example();" |
|
|
|
|
|
- name: Test CLI |
|
|
run: | |
|
|
scoutbot fetch |
|
|
scoutbot example |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|