2021-02-09 13:35:33 -06:00
|
|
|
name: On pull request
|
|
|
|
|
|
|
|
on: pull_request
|
|
|
|
|
2022-04-16 08:43:26 -05:00
|
|
|
env:
|
|
|
|
DEFAULT_PYTHON: 3.9
|
|
|
|
|
2021-02-09 13:35:33 -06:00
|
|
|
jobs:
|
2022-11-20 07:34:12 -06:00
|
|
|
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:
|
2023-09-06 08:02:16 -05:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-20 07:34:12 -06:00
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: 16.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 .
|
|
|
|
|
2021-02-09 13:35:33 -06:00
|
|
|
web_lint:
|
|
|
|
name: Web - Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-06 08:02:16 -05:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-09 13:35:33 -06:00
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
2022-03-11 05:52:41 -06:00
|
|
|
node-version: 16.x
|
2021-02-09 13:35:33 -06:00
|
|
|
- run: npm install
|
|
|
|
working-directory: ./web
|
2023-12-16 10:20:59 -06:00
|
|
|
# - name: Lint
|
|
|
|
# run: npm run lint
|
|
|
|
# working-directory: ./web
|
2021-02-09 13:35:33 -06:00
|
|
|
|
2021-02-09 13:35:33 -06:00
|
|
|
web_test:
|
|
|
|
name: Web - Test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-06 08:02:16 -05:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-09 13:35:33 -06:00
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
2023-12-16 10:20:59 -06:00
|
|
|
node-version: 20.x
|
2021-02-09 13:35:33 -06:00
|
|
|
- run: npm install
|
|
|
|
working-directory: ./web
|
2023-12-16 10:20:59 -06:00
|
|
|
# - name: Test
|
|
|
|
# run: npm run test
|
|
|
|
# working-directory: ./web
|
2022-03-05 22:16:31 -06:00
|
|
|
|
2022-04-16 08:43:26 -05:00
|
|
|
python_checks:
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-20 07:34:12 -06:00
|
|
|
name: Python Checks
|
2022-04-16 08:43:26 -05:00
|
|
|
steps:
|
|
|
|
- name: Check out the repository
|
2023-09-06 08:02:16 -05:00
|
|
|
uses: actions/checkout@v4
|
2022-04-16 08:43:26 -05:00
|
|
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
2023-12-07 06:09:20 -06:00
|
|
|
uses: actions/setup-python@v5.0.0
|
2022-04-16 08:43:26 -05:00
|
|
|
with:
|
|
|
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
|
|
- name: Install requirements
|
|
|
|
run: |
|
2023-05-29 05:31:17 -05:00
|
|
|
python3 -m pip install -U pip
|
2023-07-23 16:45:29 -05:00
|
|
|
python3 -m pip install -r docker/main/requirements-dev.txt
|
2023-11-18 08:04:43 -06:00
|
|
|
- name: Check formatting
|
2023-05-29 05:31:17 -05:00
|
|
|
run: |
|
2023-11-18 08:04:43 -06:00
|
|
|
ruff format --check --diff frigate migrations docker *.py
|
|
|
|
- name: Check lint
|
2022-04-16 08:43:26 -05:00
|
|
|
run: |
|
2023-05-29 05:31:17 -05:00
|
|
|
ruff check frigate migrations docker *.py
|
2022-04-16 08:43:26 -05:00
|
|
|
|
2022-03-10 22:41:21 -06:00
|
|
|
python_tests:
|
2022-01-14 07:31:25 -06:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-30 07:53:46 -05:00
|
|
|
name: Python Tests
|
2022-01-14 07:31:25 -06:00
|
|
|
steps:
|
|
|
|
- name: Check out code
|
2023-09-06 08:02:16 -05:00
|
|
|
uses: actions/checkout@v4
|
2022-04-24 13:52:12 -05:00
|
|
|
- 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
|
2022-01-14 07:31:25 -06:00
|
|
|
- name: Set up QEMU
|
2023-09-24 07:00:41 -05:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-01-14 07:31:25 -06:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-24 07:00:41 -05:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-03-10 22:41:21 -06:00
|
|
|
- name: Build
|
|
|
|
run: make
|
2022-04-12 08:30:55 -05:00
|
|
|
- name: Run mypy
|
|
|
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
2022-03-10 22:41:21 -06:00
|
|
|
- name: Run tests
|
2022-04-16 08:43:26 -05:00
|
|
|
run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|