-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (97 loc) · 3.71 KB
/
build-sdk.yml
File metadata and controls
109 lines (97 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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