Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
#
# SPDX-License-Identifier: Apache-2.0

# The sole reason of this file is to make github assign reviews to
# all team members explicitly.
# Every member in https://github.com/orgs/midokura/teams/device/members
# is responsible for review of any PRs in this repo.
# The each members are intentionally listed here instead of @midokura/device
# team because we want to assign reviews to individuals, not the team.
#
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners

* @midokura/device

# We need to ensure documentation is validated at PR time.
# The validation must be done before merging to ensure we can do a release and
# generate the documentation artifacts safely
*.md @jimken-mido @midokura/device
*.rst @jimken-mido @midokura/device
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--
SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation

SPDX-License-Identifier: Apache-2.0
-->

<!-- Start badge -->
<!-- End badge -->

## What?

Include an explanation of what are the changes about.

## Why?

Include an explanation of why we need the changes.
79 changes: 79 additions & 0 deletions .github/workflows/build-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
#
# SPDX-License-Identifier: Apache-2.0

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: "WASM and native modules"
on:
workflow_call:
inputs:
ref:
type: string
required: true
builder-tag:
description: The builder tag to be used
default: latest
required: false
type: string
package-namespace:
description: The package namespace for docker images
default: ${{ github.repository }}
required: false
type: string

jobs:
build-modules:
name: Modules (${{ matrix.name }}, ${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }}
strategy:
fail-fast: false
matrix:
include:
- name: raspios-bookworm
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
platform: amd64

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Build all modules
run: |
make -j$((`nproc` * 2)) \
KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config \
wasm_test_modules
make -j$((`nproc` * 2)) -C test_modules/python

- uses: actions/upload-artifact@v4
with:
name: test-modules-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
path: |
test_modules/*.elf
test_modules/*.wasm
test_modules/*.wasm.*
test_modules/python/*.zip
109 changes: 109 additions & 0 deletions .github/workflows/build-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
#
# SPDX-License-Identifier: Apache-2.0

on:
workflow_call:
inputs:
builder-tag:
description: The builder tag to be used
default: latest
required: false
type: string
package-namespace:
description: The package namespace for docker images
default: ${{ github.repository }}
required: false
type: string
ref:
type: string
required: true

jobs:
build-sdk:
name: SDK (${{ matrix.name }}, ${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }}
timeout-minutes: 8 # the worst case is 3 minutes
strategy:
fail-fast: false
matrix:
include:
- name: raspios-bookworm
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
platform: amd64

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Build SDK
run: make -j$((`nproc` * 2)) sdk \
CFLAGS="-O2 -Werror" \
KBUILD_DEFCONFIG=configs/linux-docker.config

- name: Install python test dependencies
working-directory: src/python-evp-app-sdk
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install \
-e . \
-r requirements.test.txt

- name: Run python SDK tests
working-directory: src/python-evp-app-sdk
run: |
. .venv/bin/activate
python -m pytest \
--cov=evp.app \
--cov-report="xml:pysdk-cov.xml" \
--junit-xml="pysdk-test-res.xml" \
-v

- name: Publish pytest coverage
id: pysdk-cov
uses: MishaKav/pytest-coverage-comment@main
if: always()
with:
title: EVP Python Application SDK coverage report
badge-title: Python Application SDK
coverage-path-prefix: src/python-evp-app-sdk/evp/app/
pytest-xml-coverage-path: src/python-evp-app-sdk/pysdk-cov.xml
junitxml-path: src/python-evp-app-sdk/pysdk-test-res.xml
junitxml-title: Python Application SDK test report

- name: Publish pytest results to summary
if: steps.pysdk-cov.outputs.summaryReport
run: echo ${{ steps.pysdk-cov.outputs.summaryReport }} >> $GITHUB_STEP_SUMMARY

- name: Build Python package
working-directory: src/python-evp-app-sdk
run: python3 -m build

- name: SDK Debian package
working-directory: src/python-evp-app-sdk
run: python setup.py --command-packages=stdeb.command bdist_deb

- uses: actions/upload-artifact@v4
with:
name: python-sdk-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
path: src/python-evp-app-sdk/dist/*

- uses: actions/upload-artifact@v4
with:
name: python-sdk-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
path: src/python-evp-app-sdk/deb_dist/*.deb
92 changes: 2 additions & 90 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
matrix:
include:
- name: raspios-bookworm
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
Expand Down Expand Up @@ -83,94 +83,6 @@ jobs:
sbom-files.txt
sbom-tmp.txt

build-sdk:
name: SDK (${{ matrix.name }}, ${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }}
timeout-minutes: 8 # the worst case is 3 minutes
strategy:
fail-fast: false
matrix:
include:
- name: raspios-bookworm
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
platform: arm64
- name: ubuntu-noble
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
platform: amd64

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Build SDK
run: make -j$((`nproc` * 2)) sdk \
CFLAGS="-O2 -Werror" \
KBUILD_DEFCONFIG=configs/linux-docker.config

- name: Install python test dependencies
working-directory: src/python-evp-app-sdk
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install \
-e . \
-r requirements.test.txt

- name: Run python SDK tests
working-directory: src/python-evp-app-sdk
run: |
. .venv/bin/activate
python -m pytest \
--cov=evp.app \
--cov-report="xml:pysdk-cov.xml" \
--junit-xml="pysdk-test-res.xml" \
-v

- name: Publish pytest coverage
id: pysdk-cov
uses: MishaKav/pytest-coverage-comment@main
if: always()
with:
title: EVP Python Application SDK coverage report
badge-title: Python Application SDK
coverage-path-prefix: src/python-evp-app-sdk/evp/app/
pytest-xml-coverage-path: src/python-evp-app-sdk/pysdk-cov.xml
junitxml-path: src/python-evp-app-sdk/pysdk-test-res.xml
junitxml-title: Python Application SDK test report

- name: Publish pytest results to summary
if: steps.pysdk-cov.outputs.summaryReport
run: echo ${{ steps.pysdk-cov.outputs.summaryReport }} >> $GITHUB_STEP_SUMMARY

- name: Build Python package
working-directory: src/python-evp-app-sdk
run: python3 -m build

- name: SDK Debian package
working-directory: src/python-evp-app-sdk
run: python setup.py --command-packages=stdeb.command bdist_deb

- uses: actions/upload-artifact@v4
with:
name: python-sdk-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
path: src/python-evp-app-sdk/dist/*

- uses: actions/upload-artifact@v4
with:
name: python-sdk-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
path: src/python-evp-app-sdk/deb_dist/*.deb

run-static-analysis:
name: Static Code Analysis
runs-on: ubuntu-24.04
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ concurrency:
group: ${{ github.workflow }} @ build-builders-${{ github.ref }}
cancel-in-progress: true

# COMMENT TO TRIGGER A NEW BUILD
jobs:
builder-necessary:
name: Is builder necessary?
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
if: ${{ needs.builder-necessary.outputs.build == 'true' }}
needs:
- builder-necessary
runs-on: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
runs-on: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}

steps:
- name: Checkout the code
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
- platform: amd64
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
- platform: arm64
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}

steps:
- name: Checkout the code
Expand Down
Loading
Loading