CI should install dependencies in a venv. (#79) #208
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
# This workflow will run unit test. | |
name: unit test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up virtual environment | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
- name: Install dependencies | |
run: | | |
source venv/bin/activate | |
pip install -e . | |
- name: Linting | |
run: | | |
source venv/bin/activate | |
flake8 ./ | |
- name: unit test | |
run: | | |
source venv/bin/activate | |
pytest tests | |
- name: run linear_toy_demo | |
run: | | |
source venv/bin/activate | |
python examples/linear_toy/linear_toy_demo.py | |
- name: run linear_toy_w_input_limits_demo | |
run: | | |
source venv/bin/activate | |
python examples/linear_toy/linear_toy_w_input_limits_demo.py | |
- name: run nonlinear_toy_demo | |
run: | | |
source venv/bin/activate | |
python examples/nonlinear_toy/demo.py | |
- name: run nonlinear toy demo_trigpoly | |
run: | | |
source venv/bin/activate | |
python examples/nonlinear_toy/demo_trigpoly.py --unit_test |