Skip to content

Commit

Permalink
Add test action
Browse files Browse the repository at this point in the history
Fix Actions

Fix Actions 20000
  • Loading branch information
joshuarost committed Jul 22, 2023
1 parent 2fa4d0b commit 3568ef7
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ jobs:
run: |
python -m pip install --upgrade black
- name: black format check
run: |
pylint $(git ls-files '*.py')
run: black --check --line-length 120 traffic_light/ test/ setup.py
run: black --check --line-length 120 traffic_light/ test/ setup.py

test:
strategy:
fail-fast: false
max-parallel: 6
matrix:
python-version: [3.8, 3.9, "3.10"]
os: [ubuntu-latest]
include:
- os: ubuntu-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup build and test environment
run: |
python -m pip install --upgrade pip
- name: Build Python Package
run: |
python -m pip install -r requirements-dev.txt
- name: Update pytest on >= Python3.10
if: ${{ matrix.python-version == '3.10' || matrix.python-version == '3.11' }}
run: |
python -m pip install pytest==7.0.1
- name: Unit Test with pytest
run: PYTHONPATH=. pytest test --cov=traffic_light --cov-report term-missing

0 comments on commit 3568ef7

Please sign in to comment.