mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
c2465a46a8
* Set up for http tests * Setup basics for testing and first test * Add testing consts * Cleanup db creation * Add one more check to test * Get event that does not exist * Get events working with cleaner db * Test retain / un-retain * Test setting and deleting sub label * Test getting list of sub labels * Fix bug caught in tests * Test deleting event * Test geting list of events * Expand test * Test more event filters * Write version module so tests don't fail on version import * Test config * Test recordings endpoint * Formatting * Remove unused imports * Test stats * Add cleanup files in const * Add name to match other checks
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: On pull request
|
|
|
|
on: pull_request
|
|
|
|
env:
|
|
DEFAULT_PYTHON: 3.9
|
|
|
|
jobs:
|
|
web_lint:
|
|
name: Web - Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/setup-node@master
|
|
with:
|
|
node-version: 16.x
|
|
- run: npm install
|
|
working-directory: ./web
|
|
- name: Lint
|
|
run: npm run lint
|
|
working-directory: ./web
|
|
|
|
web_test:
|
|
name: Web - Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/setup-node@master
|
|
with:
|
|
node-version: 16.x
|
|
- run: npm install
|
|
working-directory: ./web
|
|
- name: Test
|
|
run: npm run test
|
|
working-directory: ./web
|
|
|
|
python_checks:
|
|
runs-on: ubuntu-latest
|
|
name: Python checks
|
|
steps:
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v2.3.4
|
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
uses: actions/setup-python@v2.2.2
|
|
with:
|
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
- name: Install requirements
|
|
run: |
|
|
pip install pip
|
|
pip install -r requirements-dev.txt
|
|
- name: Lint
|
|
run: |
|
|
python3 -m black frigate --check
|
|
|
|
python_tests:
|
|
runs-on: ubuntu-latest
|
|
name: Python Tests
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
- uses: actions/setup-node@master
|
|
with:
|
|
node-version: 16.x
|
|
- run: npm install
|
|
working-directory: ./web
|
|
- name: Build web
|
|
run: npm run build
|
|
working-directory: ./web
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
- name: Create Version Module
|
|
run: make version
|
|
- name: Build
|
|
run: make
|
|
- name: Run mypy
|
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
|
- name: Run tests
|
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|