Update test-bikeability-v2.yml #17
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: Lint and Test Bikeability | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
lint-and-test: | |
name: Lint and Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
python-version: [ '3.10' ] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up environment bikeability | |
run: | | |
python -m venv bikeability | |
source bikeability/bin/activate | |
python -m pip install --upgrade pip | |
pip install -r .github/environments/requirements-bikeability.txt | |
shell: bash | |
- name: Set up environment lint | |
run: | | |
python -m venv lint-env | |
source lint-env/bin/activate | |
python -m pip install --upgrade pip | |
pip install -r .github/environments/requirements_lint.txt | |
shell: bash | |
- name: Run linters | |
shell: bash -l {0} | |
run: | | |
source lint-env/bin/activate | |
black . | |
flake8 . --ignore=E203,F811,W503,E501 --exclude=lint-env,bikeability/lib | |
- name: Install bikeability from TestPyPI | |
run: | | |
source bikeability/bin/activate | |
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple bikeability | |
shell: bash | |
- name: Run tests | |
run: | | |
source bikeability/bin/activate | |
pytest tests/ | |
shell: bash |