blakeblackshear.frigate/.github/workflows/pull_request.yml

81 lines
2.0 KiB
YAML
Raw Normal View History

name: On pull request
on: pull_request
2022-04-16 15:43:26 +02:00
env:
DEFAULT_PYTHON: 3.9
jobs:
web_lint:
name: Web - Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@master
with:
2022-03-11 12:52:41 +01:00
node-version: 16.x
- run: npm install
working-directory: ./web
- name: Lint
2022-03-06 05:16:31 +01:00
run: npm run lint
working-directory: ./web
2021-02-09 20:35:33 +01:00
web_test:
name: Web - Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2021-02-09 20:35:33 +01:00
- uses: actions/setup-node@master
with:
2022-03-11 12:52:41 +01:00
node-version: 16.x
2021-02-09 20:35:33 +01:00
- run: npm install
working-directory: ./web
- name: Test
run: npm run test
working-directory: ./web
2022-03-06 05:16:31 +01:00
2022-04-16 15:43:26 +02:00
python_checks:
runs-on: ubuntu-latest
name: Python checks
steps:
- name: Check out the repository
uses: actions/checkout@v3
2022-04-16 15:43:26 +02:00
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.3.0
2022-04-16 15:43:26 +02:00
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
2022-03-11 05:41:21 +01:00
python_tests:
runs-on: ubuntu-latest
name: Python Tests
steps:
- name: Check out code
uses: actions/checkout@v3
- 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@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create Version Module
run: make version
2022-03-11 05:41:21 +01:00
- name: Build
run: make
2022-04-12 15:30:55 +02:00
- name: Run mypy
run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
2022-03-11 05:41:21 +01:00
- name: Run tests
2022-04-16 15:43:26 +02:00
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest