mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
gh: add server workflow
This commit is contained in:
68
.github/workflows/test_server.yml
vendored
Normal file
68
.github/workflows/test_server.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
pep8:
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user