Files
reflector/.github/workflows/test_server.yml
Mathieu Virbel c5297be924 gh: use poetry cache from setup-python and remove old deps (#281)
* gh: use poetry cache from setup-python and remove old deps

* gh: use pipx and not setup-poetry, as per setup-python example

* server: remove pyaudio unused in current reflector
2023-10-13 15:29:54 +02:00

77 lines
1.7 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: Install poetry
run: pipx install poetry
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
cache-dependency-path: 'server/poetry.lock'
- 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
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max