Skip to content

NVR with realtime local object detection for IP cameras

Use devcontainer build to run tests (#20212)

Nicolas Mowen9a22404015b4
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index a96df22765..9f6f53523d 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -4,38 +4,14 @@ on:
pull_request:
paths-ignore:
- "docs/**"
- - ".github/**"
+ - ".github/*.yml"
+ - ".github/DISCUSSION_TEMPLATE/**"
+ - ".github/ISSUE_TEMPLATE/**"
env:
DEFAULT_PYTHON: 3.11
jobs:
- build_devcontainer:
- runs-on: ubuntu-latest
- name: Build Devcontainer
- # The Dockerfile contains features that requires buildkit, and since the
- # devcontainer cli uses docker-compose to build the image, the only way to
- # ensure docker-compose uses buildkit is to explicitly enable it.
- env:
- DOCKER_BUILDKIT: "1"
- steps:
- - uses: actions/checkout@v5
- with:
- persist-credentials: false
- - uses: actions/setup-node@master
- with:
- node-version: 20.x
- - name: Install devcontainer cli
- run: npm install --global @devcontainers/cli
- - name: Build devcontainer
- run: devcontainer build --workspace-folder .
- # It would be nice to also test the following commands, but for some
- # reason they don't work even though in VS Code devcontainer works.
- # - name: Start devcontainer
- # run: devcontainer up --workspace-folder .
- # - name: Run devcontainer scripts
- # run: devcontainer run-user-commands --workspace-folder .
-
web_lint:
name: Web - Lint
runs-on: ubuntu-latest
@@ -102,13 +78,18 @@ jobs:
uses: actions/checkout@v5
with:
persist-credentials: false
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Build
- run: make debug
- - 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
+ - uses: actions/setup-node@master
+ with:
+ node-version: 20.x
+ - name: Install devcontainer cli
+ run: npm install --global @devcontainers/cli
+ - name: Build devcontainer
+ env:
+ DOCKER_BUILDKIT: "1"
+ run: devcontainer build --workspace-folder .
+ - name: Start devcontainer
+ run: devcontainer up --workspace-folder .
+ - name: Run mypy in devcontainer
+ run: devcontainer exec --workspace-folder . bash -lc "python3 -u -m mypy --config-file frigate/mypy.ini frigate"
+ - name: Run unit tests in devcontainer
+ run: devcontainer exec --workspace-folder . bash -lc "python3 -u -m unittest"