BAPSicle/.github/workflows/test.yaml

51 lines
1.4 KiB
YAML
Raw Normal View History

2021-04-10 22:05:12 +00:00
name: Python test
2020-10-24 12:56:58 +00:00
on: [push]
jobs:
2021-04-07 21:21:46 +00:00
test-macos:
2020-10-24 12:56:58 +00:00
runs-on: macos-latest
timeout-minutes: 15
2020-10-24 12:56:58 +00:00
strategy:
fail-fast: false
2020-10-24 12:56:58 +00:00
matrix:
2021-04-08 22:29:44 +00:00
python-version: [3.8, 3.9]
2020-10-24 12:56:58 +00:00
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
2020-10-26 21:36:01 +00:00
- name: Install Python dependencies
2020-10-24 12:56:58 +00:00
run: |
python -m pip install --upgrade pip
2020-10-24 15:17:35 +00:00
pip install flake8
pip install -r build/requirements.txt
pip install -r build/requirements-macos.txt
2020-10-24 15:16:41 +00:00
- name: Install bapsicle as module
run: |
pip install -e .
2020-10-24 12:56:58 +00:00
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
2021-04-08 20:25:58 +00:00
flake8 . --count --ignore=E402,E226,E24,W50,W690 --max-complexity=20 --max-line-length=127 --statistics
2020-10-24 15:16:41 +00:00
- name: Test with unittest
2021-04-08 19:41:21 +00:00
if: ${{ always() }}
timeout-minutes: 10
2020-10-24 12:56:58 +00:00
run: |
2021-04-07 20:52:23 +00:00
python -m sounddevice
2021-04-07 20:01:32 +00:00
python -m unittest
2021-04-07 21:17:10 +00:00
- name: Archive test logs
2021-04-07 21:25:39 +00:00
if: ${{ always() }}
2021-04-07 21:17:10 +00:00
uses: actions/upload-artifact@v2
2021-04-07 21:15:24 +00:00
with:
name: Logs - Python ${{ matrix.python-version }}
2021-04-07 21:15:24 +00:00
path: |
logs/*