Skip to content

Install subset of optional dependencies in CI #12

Install subset of optional dependencies in CI

Install subset of optional dependencies in CI #12

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
runs-on: ubuntu-latest
needs: code-linting
strategy:
fail-fast: false
matrix:
script:
- src/charmory_examples/image_classification/mnist_vit_pgd.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
run: cd examples && pip install --no-compile --editable .[armory,huggingface]
- name: Test
run: cd examples && python ${{ matrix.script }}
generate-docs:
name: πŸ“– Generate Docs
runs-on: ubuntu-latest
needs:
- code-linting
- unit-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:
- code-linting
- unit-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