mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-26 19:41:29 +08:00
Use devcontainer build to run tests (#20212)
* Use devcontainer build to run tests * Make ignored github changes more restrictive
This commit is contained in:
55
.github/workflows/pull_request.yml
vendored
55
.github/workflows/pull_request.yml
vendored
@@ -4,38 +4,14 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- ".github/**"
|
- ".github/*.yml"
|
||||||
|
- ".github/DISCUSSION_TEMPLATE/**"
|
||||||
|
- ".github/ISSUE_TEMPLATE/**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEFAULT_PYTHON: 3.11
|
DEFAULT_PYTHON: 3.11
|
||||||
|
|
||||||
jobs:
|
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:
|
web_lint:
|
||||||
name: Web - Lint
|
name: Web - Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -102,13 +78,18 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Set up QEMU
|
- uses: actions/setup-node@master
|
||||||
uses: docker/setup-qemu-action@v3
|
with:
|
||||||
- name: Set up Docker Buildx
|
node-version: 20.x
|
||||||
uses: docker/setup-buildx-action@v3
|
- name: Install devcontainer cli
|
||||||
- name: Build
|
run: npm install --global @devcontainers/cli
|
||||||
run: make debug
|
- name: Build devcontainer
|
||||||
- name: Run mypy
|
env:
|
||||||
run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
DOCKER_BUILDKIT: "1"
|
||||||
- name: Run tests
|
run: devcontainer build --workspace-folder .
|
||||||
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|
- 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"
|
||||||
|
Reference in New Issue
Block a user