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
50 changes: 37 additions & 13 deletions .github/actions/loading/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ outputs:
build_matrix:
description: Build matrix
value: ${{ steps.set-matrix.outputs.build_matrix }}

full_matrix:
description: full matrix containing lava devails
description: Full matrix containing lava details
value: ${{ steps.set-matrix.outputs.full_matrix }}

runs:
Expand All @@ -21,24 +20,49 @@ runs:
script: |
const fs = require('fs');
const path = require('path');
const targetsPath = path.join(process.env.GITHUB_WORKSPACE, 'video-driver', 'ci', 'MACHINES.json');

// 1. Define possible paths for MACHINES.json
// Path A: Workspace/video-driver/ci/MACHINES.json (Nested)
const pathNested = path.join(process.env.GITHUB_WORKSPACE, 'video-driver', 'ci', 'MACHINES.json');
// Path B: Workspace/ci/MACHINES.json (Root)
const pathRoot = path.join(process.env.GITHUB_WORKSPACE, 'ci', 'MACHINES.json');

let targetsPath = '';

// 2. Check which path exists
if (fs.existsSync(pathNested)) {
console.log(`Found config at nested path: ${pathNested}`);
targetsPath = pathNested;
} else if (fs.existsSync(pathRoot)) {
console.log(`Found config at root path: ${pathRoot}`);
targetsPath = pathRoot;
} else {
// 3. Debugging: If neither exists, list files to help us see what is happening
console.log('!!! Error: MACHINES.json not found in expected locations.');
console.log(`Checked: ${pathNested}`);
console.log(`Checked: ${pathRoot}`);

console.log('--- Workspace Root Contents ---');
try {
console.log(fs.readdirSync(process.env.GITHUB_WORKSPACE));
} catch (e) { console.log(e.message); }

core.setFailed(`MACHINES.json not found.`);
return;
}

// 4. Parse the file
let targets;
try {
if (!fs.existsSync(targetsPath)) {
core.setFailed(`MACHINES.json not found at ${targetsPath}`);
return;
}
targets = JSON.parse(fs.readFileSync(targetsPath, 'utf-8'));
} catch (err) {
core.setFailed(`Failed to load or parse MACHINES.json: ${err.message}`);
core.setFailed(`Failed to parse MACHINES.json: ${err.message}`);
return;
}
// Build matrix: machine, firmware

// 5. Generate Outputs
const build_matrix = Object.values(targets).map(({ machine, firmware }) => ({ machine, firmware }));
core.setOutput('build_matrix', JSON.stringify(build_matrix));
console.log("Build Matrix:", build_matrix);

// Full matrix: machine, firmware, lavaname
const full_matrix = Object.values(targets).map(({ machine, firmware, lavaname }) => ({ machine, firmware, lavaname }));
core.setOutput('full_matrix', JSON.stringify(full_matrix));
console.log("Full Matrix:", full_matrix);
core.setOutput('full_matrix', JSON.stringify(full_matrix));
25 changes: 22 additions & 3 deletions .github/workflows/loading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ description: Load required parameters for the subsequent jobs

on:
workflow_call:
inputs:
target_branch:
description: "Branch to checkout (optional)"
required: false
type: string
default: ""
outputs:
build_matrix:
description: Build matrix
value: ${{ jobs.loading.outputs.build_matrix }}

full_matrix:
description: Full Matrix containing lava description
value: ${{ jobs.loading.outputs.full_matrix }}
Expand All @@ -20,14 +25,28 @@ jobs:
build_matrix: ${{ steps.loading.outputs.build_matrix }}
full_matrix: ${{ steps.loading.outputs.full_matrix }}
steps:
- name: Sync codebase
# SCENARIO 1: Pull Request (Pre-Merge)
# Uses your custom sync action to merge PR code with base
- name: Sync codebase (PR)
if: github.event_name == 'pull_request'
uses: qualcomm-linux/video-driver/.github/actions/sync@video.qclinux.0.0
with:
event_name: ${{ github.event_name }}
pr_ref: ${{ github.event.pull_request.head.ref }}
pr_repo: ${{ github.event.pull_request.head.repo.full_name }}
base_ref: ${{ github.ref_name }}

# SCENARIO 2: Schedule or Manual (Post-Merge)
# Uses standard checkout because there is no PR to sync
- name: Checkout Code (Schedule)
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
with:
# Use the input branch if provided, otherwise default to current ref
ref: ${{ inputs.target_branch || github.ref_name }}
# Check out into 'video-driver' folder so the script finds the nested path
path: video-driver

- name: Load Parameters
id: loading
uses: qualcomm-linux/video-driver/.github/actions/loading@video.qclinux.0.0
uses: qualcomm-linux/video-driver/.github/actions/loading@video.qclinux.0.0
5 changes: 2 additions & 3 deletions .github/workflows/post_merge.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: post_merge_weekly
name: Post Merge Weekly
description: |
Runs post-merge CI for the video-driver repository on a weekly schedule.
Reuses loading, build and test workflows.

on:
schedule:
# Every Monday and Thursday at 02:30 UTC (8:00 AM IST)
- cron: "30 2 * * 1,4"
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qcom-preflight-checks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Qualcomm Preflight Checks
on:
pull_request_target:
branches: [ development ]
branches: [ video.qclinux.0.0 ]
push:
branches: [ development ]
branches: [ video.qclinux.0.0 ]
workflow_dispatch:

permissions:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/sync-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ jobs:
uses: qualcomm-linux/kernel-config/.github/actions/pull_docker_image@main
with:
image: ${{ inputs.docker_image }}


# ------------------------------------------------------------------------
# ✅ CRITICAL FIX: Explicitly checkout the driver code.
# This ensures the source code exists for Post-Merge/Scheduled runs.
# ------------------------------------------------------------------------
- name: Checkout Video Driver
uses: actions/checkout@v4
with:
path: video-driver
fetch-depth: 0

- name: Sync codebase
uses: qualcomm-linux/video-driver/.github/actions/sync@video.qclinux.0.0
with:
Expand All @@ -38,11 +48,19 @@ jobs:
base_ref: ${{ github.ref_name }}
caller_workflow: build


- name: Build workspace
uses: qualcomm-linux/video-driver/.github/actions/build@video.qclinux.0.0
with:
docker_image: kmake-image:ver.1.0
workspace_path: ${{ github.workspace }}

- name: Fix Workspace Ownership
if: always()
shell: bash
run: |
echo "🔧 Fixing file ownership (root -> runner user)..."
sudo chown -R $(id -u):$(id -g) ${{ github.workspace }}

- name: Download iris_test_app from the s3
shell: bash
Expand Down Expand Up @@ -287,4 +305,4 @@ jobs:
done < "$file_list"
fi
echo "</details>"
} >> "$GITHUB_STEP_SUMMARY"
} >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion ci/MACHINES.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"qcs6490-rb3gen2": {
"machine": "qcs6490-rb3gen2",
"firmware": "rb3gen2",
"lavaname": "qcs6490",
"lavaname": "qcs6490-rb3gen2",
"target": "qcs6490-rb3gen2",
"buildid": "QCM6490.LE.1.0-00376-STD.PROD-1",
"firmwareid": "rb3gen2"
Expand Down