Skip to content
Merged
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
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-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-22.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-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-22.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 @@ -41,7 +41,7 @@ jobs:
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' }}
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-22.04' }}
platform: amd64
steps:
- name: Checkout source
Expand Down Expand Up @@ -83,97 +83,9 @@ 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
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag }}
options: --user 1001:127
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ concurrency:
jobs:
builder-necessary:
name: Is builder necessary?
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
outputs:
build: ${{ steps.changed-files.outputs.all_changed_and_modified_files != '' }}
builder-tag: ${{ steps.builder-tag.outputs.tag }}
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
matrix:
include:
- platform: amd64
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-22.04' }}
- platform: arm64
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }}

Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- builder-necessary
- build-push-ubuntu
name: Docker manifest
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04

steps:
- name: Login to Github Registry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:
check:
name: Formatting
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag}}
options: --user 1001:127
Expand Down
Loading
Loading