Skip to content

Commit

Permalink
Merge branch 'master' into fix-1851-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino committed Dec 12, 2024
2 parents 662cac5 + ba26fda commit 165f049
Show file tree
Hide file tree
Showing 156 changed files with 7,606 additions and 15,373 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[flake8]
exclude =
anthias_app/migrations/*.py
per-file-ignores =
bin/migrate.py: E501
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Run ansible-lint
uses: ansible-community/ansible-lint-action@main
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/build-balena-disk-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,26 @@ on:
default: 'master'

jobs:
generate-openapi-schema:
uses: ./.github/workflows/generate-openapi-schema.yml
permissions:
contents: write
with:
release: true
tag: ${{ inputs.tag }}
commit: ${{ inputs.commit }}
balena-build-images:
strategy:
matrix:
board: ['pi1', 'pi2', 'pi3', 'pi4']
runs-on: ubuntu-20.04
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4

- name: Get base board
run: |
Expand Down Expand Up @@ -54,6 +64,7 @@ jobs:
preload \
"$BALENA_IMAGE.img" \
--fleet screenly_ose/anthias-${{ matrix.board }} \
--pin-device-to-release \
--splash-image ansible/roles/splashscreen/files/splashscreen.png \
--commit latest
balena_cli_version: 18.1.2
Expand Down Expand Up @@ -105,3 +116,8 @@ jobs:
artifacts: "*raspberry*.zip,*raspberry*.sha256,*raspberry*.json"
tag: ${{ inputs.tag }}
commit: ${{ inputs.commit }}

- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{ github.workspace }}/*raspberry*.zip'
14 changes: 7 additions & 7 deletions .github/workflows/build-webview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
if: success() && github.event_name != 'pull_request'
Expand Down Expand Up @@ -56,17 +56,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache build layers
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: /tmp/.cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v2

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand Down
39 changes: 29 additions & 10 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- experimental
paths:
- '**'
- '!webview/**'
Expand All @@ -17,7 +16,9 @@ on:
- '!docs/**'
- '!bin/install.sh'
- '!bin/upgrade_containers.sh'
- '!bin/start_development_server.sh'
- '!tests/**'
- '!docker/Dockerfile.dev'

jobs:
run-tests:
Expand All @@ -28,21 +29,40 @@ jobs:
strategy:
matrix:
board: ['pi1', 'pi2', 'pi3', 'pi4', 'x86']
python-version: ["3.11"]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.venv
installer-parallel: true

- name: Install dependencies
run: |
poetry install --only=docker-image-builder
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
Expand All @@ -59,10 +79,9 @@ jobs:

- name: Build Containers
run: |
export BUILD_TARGET=${{ matrix.board }}
export PUSH=1
export SKIP_TEST=1
./bin/build_containers.sh
poetry run python tools/image_builder \
--build-target=${{ matrix.board }} \
--push
balena:
if: ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -73,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set Docker tag
run: |
Expand Down
54 changes: 38 additions & 16 deletions .github/workflows/docker-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- experimental
paths:
- '**/**'
- '!README.md'
Expand All @@ -16,7 +15,6 @@ on:
pull_request:
branches:
- master
- experimental
paths:
- '**/**'
- '!README.md'
Expand All @@ -30,12 +28,33 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.venv
installer-parallel: true

- name: Install dependencies
run: |
poetry install --only=docker-image-builder
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
Expand All @@ -45,29 +64,32 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build Containers
run: |
export SKIP_SERVER=1
export SKIP_WEBSOCKET=1
export SKIP_NGINX=1
export SKIP_VIEWER=1
export SKIP_WIFI_CONNECT=1
./bin/build_containers.sh
poetry run python tools/image_builder \
--dockerfiles-only \
--disable-cache-mounts \
--service celery \
--service redis \
--service test
- name: Start the test container
run: |
docker compose -f docker-compose.test.yml up -d
docker compose -f docker-compose.test.yml up -d --build
- name: Run the unit tests inside the container
run: |
docker compose -f docker-compose.test.yml exec anthias-test ./manage.py test --noinput --parallel --exclude-tag=integration
- name: Run the tests inside the container
shell: 'script -q -e -c "bash {0}"'
- name: Run the integration tests inside the container
run: |
docker compose -f docker-compose.test.yml exec anthias-test bash ./bin/prepare_test_environment.sh -s
docker compose -f docker-compose.test.yml exec anthias-test nose2 -v
docker compose -f docker-compose.test.yml exec anthias-test ./manage.py test --noinput --tag=integration
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
Loading

0 comments on commit 165f049

Please sign in to comment.