Skip to content
Open
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
291 changes: 291 additions & 0 deletions .github/workflows/build-yocto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
name: Build Yocto

on:
workflow_call:
inputs:
sdk:
required: false
type: string
default: "0"
outputs:
artifacts_url:
description: "URL to retrieve build artifacts"
value: ${{ jobs.create-output.outputs.url }}

# Concurrency is used to prevent multiple workflows from running for the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: true

env:
CACHE_DIR: /efs/qli/meta-qcom
KAS_CLONE_DEPTH: 1

jobs:
kas-setup:
if: github.repository_owner == 'qualcomm-linux'
runs-on: [self-hosted, qcom-u2404, amd64]
steps:
- name: Setting up kas-container
run: |
KAS_CONTAINER=$RUNNER_TEMP/kas-container
echo "KAS_CONTAINER=$KAS_CONTAINER" >> $GITHUB_ENV
LATEST=$(git ls-remote --tags --refs --sort="v:refname" https://github.com/siemens/kas | tail -n1 | sed 's/.*\///')
wget -qO ${KAS_CONTAINER} https://raw.githubusercontent.com/siemens/kas/refs/tags/$LATEST/kas-container
chmod +x ${KAS_CONTAINER}

- uses: actions/checkout@v4
with:
repository: qualcomm-linux/meta-qcom
ref: master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After we branch for release, this needs to get updated. We could reuse the same branch name, but that would need a git branch aliasfor master<>main in meta-qcom.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be possible at a later step of the distro ci integration to fetch this layer using kas like for all the others. So we'll stop specifying this here on the github workflow.


- uses: actions/checkout@v4
with:
path: meta-qcom-distro

- name: Prepare kas qcom-distro yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this patch. and I don't think we should copy KAS config files here, hidden in CI.

We need to decide if we keep the KAS config files for meta-qcom-distro in meta-qcom (1) or if we move them in meta-qcom-distro (2).

If we pick (1) then we should clone meta-qcom and use the KAS files from there, and find a way to fetch the right commit for meta-qcom-distro (it can be main for a push event, but it can be a PR branch too).

If we pick (2), we should clone meta-qcom-distro and let kas clone meta-qcom

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to use (2) and with that we can drop this this patch. But that will have to be done later because it includes changes in both repositories which have to be done in some synchronized way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then testing of meta-qcom starts to depend on meta-qcom-distro, which is also not so good.

(3) make a copy of KAS configs in meta-qcom-distro ?

That would create duplication, but at the same time it would allow us to customize per-machine configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already depends, currently testing of meta-qcom does not work without meta-qcom-distro.
Moving all qcom-distro bits and pieces to meta-qcom-distro layer would eliminate that dependency.
And we would make the distro dependent on BSP, not the other way around.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please. Duplicate those files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a questions duplications:

    workflows/build-yocto: add qcom-distro yml local override
    
    This change is intended only to have a functional build with minimal modifications and
    is temporary; it will be reverted in subsequent iterations of the distro ci integration.
    
    We need the primary repository to be meta-qcom so we can keep using its github/actions
    with minimal changes. To do this, we'll first checkout meta-qcom as the primary
    repository and then meta-qcom-distro inside it.
    
    The last part we need for this is the new kas config which will allow us to change the
    layer structure used by kas here. This configuration has the necessary changes for
    move the meta-qcom-distro layer as well as the differences of meta-qcom layer.
    Instead of meta-qcom-distro being an external layer like in meta-qcom ci,
    it becomes a internal layer of meta-qcom here.

run: |
# move meta-qcom-distro layer: from external repo to meta-qcom internal layer
cp ci/qcom-distro.yml ci/qcom-distro-full.yml
cp meta-qcom-distro/ci/qcom-distro.yml ci/

- name: Run kas lock
run: |
${KAS_CONTAINER} lock --update ci/base.yml:ci/qcom-distro.yml

- name: Upload kas lockfile
uses: actions/upload-artifact@v6
with:
name: kas-lockfile
path: ci/*.lock.yml

- name: Upload kas-container
uses: actions/upload-artifact@v4
with:
name: kas-container
path: ${{ env.KAS_CONTAINER }}

compile_warm_up:
needs: kas-setup
if: github.repository_owner == 'qualcomm-linux'
runs-on: [self-hosted, qcom-u2404, amd64]
strategy:
fail-fast: true
matrix:
machine:
- rb3gen2-core-kit
- qcom-armv8a
distro:
- name: qcom-distro
yamlfile: ':ci/qcom-distro-prop-image.yml'
- name: qcom-distro-catchall
yamlfile: ':ci/qcom-distro-catchall.yml'
- name: performance
yamlfile: ':ci/qcom-distro-prop-image.yml:ci/performance.yml'
kernel:
- type: default
dirname: ""
yamlfile: ""
- type: 6.18
dirname: "+linux-qcom-6.18"
yamlfile: ":ci/linux-qcom-6.18.yml"
- type: rt-6.18
dirname: "+linux-qcom-rt-6.18"
yamlfile: ":ci/linux-qcom-rt-6.18.yml"
name: ${{ matrix.machine }}/${{ matrix.distro.name }}${{ matrix.kernel.dirname }}
steps:
- uses: actions/checkout@v4
with:
repository: qualcomm-linux/meta-qcom
ref: master

- uses: actions/checkout@v4
with:
path: meta-qcom-distro

- name: Prepare kas qcom-distro yml
run: |
# move meta-qcom-distro layer: from external repo to meta-qcom internal layer
cp ci/qcom-distro.yml ci/qcom-distro-full.yml
cp meta-qcom-distro/ci/qcom-distro.yml ci/

- name: Run kas build
uses: qualcomm-linux/meta-qcom/.github/actions/compile@master
with:
machine: ${{matrix.machine}}
distro_yaml: ${{matrix.distro.yamlfile}}
distro_name: ${{matrix.distro.name}}
kernel_yaml: ${{matrix.kernel.yamlfile}}
kernel_dirname: ${{matrix.kernel.dirname}}
cache_dir: ${CACHE_DIR}
sdk: ${{inputs.sdk}}

compile:
needs: compile_warm_up
if: github.repository_owner == 'qualcomm-linux'
runs-on: [self-hosted, qcom-u2404, amd64]
outputs:
url: ${{ steps.compile_kas.outputs.url }}
strategy:
fail-fast: true
matrix:
machine:
- iq-615-evk
- iq-8275-evk
- iq-9075-evk
- iq-x7181-evk
- kaanapali-mtp
- qcm6490-idp
- qcs615-ride
- qcs8300-ride-sx
- qcs9100-ride-sx
- rb1-core-kit
- sm8750-mtp
distro:
- name: qcom-distro
yamlfile: ':ci/qcom-distro-prop-image.yml'
- name: qcom-distro-catchall
yamlfile: ':ci/qcom-distro-catchall.yml'
- name: performance
yamlfile: ':ci/qcom-distro-prop-image.yml:ci/performance.yml'
kernel:
- type: default
dirname: ""
yamlfile: ""
- type: 6.18
dirname: "+linux-qcom-6.18"
yamlfile: ":ci/linux-qcom-6.18.yml"
- type: rt-6.18
dirname: "+linux-qcom-rt-6.18"
yamlfile: ":ci/linux-qcom-rt-6.18.yml"
include:
# Additional builds for specific machines
- machine: qcom-armv8a
distro:
name: qcom-distro
yamlfile: ':ci/qcom-distro-prop-image.yml'
kernel:
type: additional
dirname: "+linux-yocto-dev"
yamlfile: ":ci/linux-yocto-dev.yml"
- machine: iq-9075-evk
distro:
name: qcom-distro
yamlfile: ':ci/qcom-distro-prop-image.yml'
kernel:
type: qcom-next-rt
dirname: "+linux-qcom-next-rt"
yamlfile: ":ci/linux-qcom-next-rt.yml"
- machine: iq-9075-evk
distro:
name: qcom-distro-kvm
yamlfile: ':ci/qcom-distro-kvm.yml'
kernel:
type: default
dirname: ""
yamlfile: ""
- machine: iq-8275-evk
distro:
name: qcom-distro-kvm
yamlfile: ':ci/qcom-distro-kvm.yml'
kernel:
type: default
dirname: ""
yamlfile: ""
- machine: qcom-armv7a
distro:
name: qcom-distro
yamlfile: ':ci/qcom-distro.yml'
kernel:
type: default
dirname: ""
yamlfile: ""
name: ${{ matrix.machine }}/${{ matrix.distro.name }}${{ matrix.kernel.dirname }}
steps:
- uses: actions/checkout@v4
with:
repository: qualcomm-linux/meta-qcom
ref: master

- uses: actions/checkout@v4
with:
path: meta-qcom-distro

- name: Prepare kas qcom-distro yml
run: |
# move meta-qcom-distro layer: from external repo to meta-qcom internal layer
cp ci/qcom-distro.yml ci/qcom-distro-full.yml
cp meta-qcom-distro/ci/qcom-distro.yml ci/

- name: Run kas build
uses: qualcomm-linux/meta-qcom/.github/actions/compile@master
id: compile_kas
with:
machine: ${{matrix.machine}}
distro_yaml: ${{matrix.distro.yamlfile}}
distro_name: ${{matrix.distro.name}}
kernel_yaml: ${{matrix.kernel.yamlfile}}
kernel_dirname: ${{matrix.kernel.dirname}}
cache_dir: ${CACHE_DIR}
sdk: ${{inputs.sdk}}

publish_summary:
needs: compile
runs-on: [self-hosted, qcom-u2404, amd64]
steps:
- name: 'Download build URLs'
uses: actions/download-artifact@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pattern: build-url*
path: urlfiles
merge-multiple: true

- name: "Print output"
shell: python
id: print-output
run: |
import os
ftable = {}
oslist = set()
machinelist = set()
for fname in os.listdir("./urlfiles"):
if fname.startswith("build-url"):
b, m, o = fname.split("_", 2)
oslist.add(o)
machinelist.add(m)
url = ""
with open(f"./urlfiles/{fname}", "r") as urlfile:
url = urlfile.read()
if not o in ftable:
ftable.update({o:{m: url}})
else:
ftable[o].update({m: url})

table_str = "| |"

for m in sorted(machinelist):
table_str += f" {m} |"

table_str += "\n|"
for i in range(len(machinelist) + 1):
table_str += " ---- |"

table_str += "\n"

for o in sorted(ftable.keys()):
table_str += f"| {o} |"
for m in sorted(machinelist):
url = ftable[o].get(m)
if url:
url = url.strip()
table_str += f" [Files]({url}/{o}/{m}/) |"
else:
table_str += " |"
table_str += "\n"
summary_file_name = os.environ.get("GITHUB_STEP_SUMMARY")
if summary_file_name:
with open(summary_file_name, "a") as summaryfile:
summaryfile.write("## Download URLs\n")
summaryfile.write(table_str)
print(table_str)
28 changes: 28 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build on PR

on:
pull_request:
paths-ignore:
- 'README.md'
- 'README'
- 'SECURITY.md'

permissions:
checks: write
pull-requests: write
contents: read
packages: read

jobs:
event-file:
name: "Upload event file"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v6
with:
name: Event File
path: ${{ github.event_path }}
build-pr:
uses: ./.github/workflows/build-yocto.yml

73 changes: 73 additions & 0 deletions .github/workflows/publish-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish test results

on:
workflow_call:
inputs:
workflow_id:
required: true
type: string
event_name:
required: true
type: string
event_file:
required: true
type: string
commit:
required: true
type: string

permissions:
checks: write
pull-requests: write
contents: read
packages: read

jobs:
publish-test-results:
name: "Publish Tests Results"
runs-on: ubuntu-latest
steps:
- name: Download result files
uses: actions/download-artifact@v6
with:
run-id: ${{ inputs.workflow_id }}
path: artifacts
github-token: ${{ github.token }}

- name: Download result files PR
if: ${{ github.run_id != inputs.workflow_id }}
uses: actions/download-artifact@v6
with:
path: artifacts
github-token: ${{ github.token }}

- name: "List files"
id: listfiles
run: |
echo $GITHUB_WORKSPACE
ls -R $GITHUB_WORKSPACE
if ! find "${{ github.workspace }}/artifacts/" -name '*.xml' -print -quit | grep -q .; then
echo "Error: no .xml files found"
exit 1
fi

- id: app_token
uses: actions/create-github-app-token@v2
if: always()
with:
app-id: 2291458
private-key: ${{ secrets.TEST_REPORTING_APP_TOKEN }}

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: |
always()
&& contains(steps.listfiles.outcome, 'success')
with:
commit: ${{ inputs.commit }}
event_file: ${{ inputs.event_file}}
event_name: ${{ inputs.event_name }}
files: "${{ github.workspace }}/artifacts/**/*.xml"
action_fail: true
action_fail_on_inconclusive: true
github_token: ${{ steps.app_token.outputs.token }}
Loading
Loading