Skip to content

initial commit for colab notebook #109

initial commit for colab notebook

initial commit for colab notebook #109

Workflow file for this run

---
name: 🚧 Build & Test
on:
workflow_dispatch:
push:
pull_request:
branches:
- master
jobs:
code-linting:
name: 🧹 Code Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install pre-commit
run: pip3 install pre-commit
- name: Lint
run: make lint
static-analysis:
name: 🔍 Static Analysis
runs-on: ubuntu-latest
needs: code-linting
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install tools
run: pip3 install bandit mypy
- name: Scan
run: make scan
- name: Upload Scan Results
uses: actions/upload-artifact@v3
with:
name: armory-library-bandit
path: bandit_scan.txt
retention-days: 1
unit-tests:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
needs: code-linting
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: make install
- name: Test
run: make test
integration-tests:
name: 🧪 Integration Tests - ${{ matrix.test.name }}
runs-on: ubuntu-latest
needs: code-linting
strategy:
fail-fast: false
matrix:
test:
- name: Image Classification
dir: src/charmory_examples/image_classification
script: mnist_vit_pgd.py --batch-size 2 --num-batches 1 --export-every-n-batches 1
- name: Object Detection
dir: src/charmory_examples/object_detection
script: license_plates_yolov5_robustdpatch.py --batch-size 2 --num-batches 1 --export-every-n-batches 1
python-version: ["3.8"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
# Consider switching to a non-yolo OD example and removing the yolo install,
# it adds 2-ish minutes to this install step.
run: cd examples && pip install --no-compile --editable .[armory,huggingface,yolo]
- name: Test
run: cd examples/${{ matrix.test.dir }} && python ${{ matrix.test.script }}
generate-docs:
name: 📖 Generate Docs
runs-on: ubuntu-latest
needs:
- unit-tests
- integration-tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install tools
run: pip install mkdocs mkdocstrings mkdocs-exclude mkdocs-material
- name: Generate
run: make docs
- name: Upload Docs
uses: actions/upload-artifact@v3
with:
name: armory-library-docs
path: public
retention-days: 1
build:
name: 🔨 Build
runs-on: ubuntu-latest
needs:
- unit-tests
- integration-tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install
run: make install
- name: Build
run: make build
- name: Upload Wheel
uses: actions/upload-artifact@v3
with:
name: armory-library-wheel
path: dist/*.whl
retention-days: 7