mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
83 lines
1.9 KiB
YAML
83 lines
1.9 KiB
YAML
name: Unittests
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'www/**'
|
|
push:
|
|
paths-ignore:
|
|
- 'www/**'
|
|
|
|
jobs:
|
|
pytest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.11
|
|
- uses: Gr1N/setup-poetry@v8
|
|
- name: Cache Python requirements
|
|
uses: actions/cache@v2
|
|
id: cache-pip
|
|
with:
|
|
path: ~/.cache/pypoetry/virtualenvs
|
|
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
|
|
restore-keys: |
|
|
- ${{ runner.os }}-poetry-
|
|
- name: Install tests dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y portaudio19-dev build-essential
|
|
- name: Install requirements
|
|
run: |
|
|
cd server
|
|
poetry install
|
|
- name: Tests
|
|
run: |
|
|
cd server
|
|
poetry run python -m pytest -v tests
|
|
|
|
formatting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.11
|
|
- name: Validate formatting
|
|
run: |
|
|
pip install black
|
|
cd server
|
|
black --check reflector tests
|
|
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.11
|
|
- name: Validate formatting
|
|
run: |
|
|
pip install ruff
|
|
cd server
|
|
ruff reflector tests
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: server
|