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
9 changes: 8 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ inputs:
description: Docker image
required: true
default: kmake-image:latest
workspace_path:
description: Workspace path
required: true

runs:
using: "composite"
steps:
- name: Download artifacts
shell: bash
run: |
cd ${{ inputs.workspace_path }}
mkdir -p ../artifacts && \
wget -O ../artifacts/ramdisk.gz https://snapshots.linaro.org/member-builds/qcomlt/testimages/arm64/1379/initramfs-test-image-qemuarm64-20230321073831-1379.rootfs.cpio.gz && \
wget -O ../artifacts/systemd-boot-efi.deb http://ports.ubuntu.com/pool/universe/s/systemd/systemd-boot-efi_255.4-1ubuntu8_arm64.deb && \
Expand All @@ -21,6 +25,7 @@ runs:
- name: Make
shell: bash
run: |
cd ${{ inputs.workspace_path }}
docker run -i --rm \
--user $(id -u):$(id -g) \
--workdir="$PWD" \
Expand All @@ -34,4 +39,6 @@ runs:
- name: Package DLKM into ramdisk
shell: bash
run: |
(cd ../kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)
cd ${{ inputs.workspace_path }}
(cd ../kobj/tar-install ; find lib/modules | cpio -o -H newc -R +0:+0 | gzip -9 >> ../../artifacts/ramdisk.gz)

84 changes: 84 additions & 0 deletions .github/actions/sync/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Sync workspace

inputs:
base_branch:
description: Base branch
required: true
default: qcom-next-staging
pr_number:
description: PR number
required: false

outputs:
workspace_path:
description: Sync workspace path
value: ${{ steps.set-workspace.outputs.workspace }}

runs:
using: "composite"
steps:
- name: Checkout PR branch
if: inputs.base_branch == 'qcom-next-staging'
uses: actions/checkout@v4
shell: bash
with:
fetch-depth: 0

- name: Configure git
shell: bash
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"

- name: Sync with latest changes
if: inputs.base_branch == 'qcom-next-staging'
shell: bash
run: |
set -e
echo "Syncing with latest changes..."
git fetch origin ${{ inputs.base_branch }}
git merge --no-ff origin/${{ inputs.base_branch }}

- name: Clone repositories
if: inputs.base_branch != 'qcom-next-staging'
shell: bash
run: |
git clone https://github.com/qualcomm-linux/kernel.git
git clone https://github.com/qualcomm-linux/automerge.git

- name: Create merge configuration
if: inputs.base_branch != 'qcom-next-staging'
shell: bash
run: |
TOPIC_BRANCH=${{ inputs.base_branch }}
cat <<EOF > merge.conf
baseline https://github.com/qualcomm-linux/kernel.git qcom-next
topic https://github.com/qualcomm-linux/kernel-topics.git $TOPIC_BRANCH
EOF
echo "File 'merge.conf' created successfully."

- name: Run auto merge
id: automerge
if: inputs.base_branch != 'qcom-next-staging'
shell: bash
run: |
cd kernel
../automerge/ci-merge -f ../merge.conf -t head -n

- name: Fetch PR
if: inputs.base_branch != 'qcom-next-staging'
shell: bash
run: |
cd kernel
git fetch https://github.com/qualcomm-linux/kernel-topics.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
git merge pr-${{inputs.pr_number}} --no-commit
git commit -m "Merged PR ${{inputs.pr_number}}"

- name: Set workspace path
id: set-workspace
shell: bash
run: |
if [[ "${{ inputs.base_branch }}" == "qcom-next-staging" ]]; then
echo "workspace=${{ github.workspace }}" >> "$GITHUB_OUTPUT"
else
echo "workspace=${{ github.workspace }}/kernel" >> "$GITHUB_OUTPUT"
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
group: GHA-Kernel-SelfHosted-RG
labels: [ self-hosted, kernel-prd-u2404-x64-large-od-ephem ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Sync codebase
id: sync
uses: ./.github/actions/sync
with:
ref: ${{ github.ref }}
fetch-depth: 0
base_branch: ${{ github.base_ref }}
pr_number: ${{ github.event.pull_request.number }}

- name: Pull docker image
uses: ./.github/actions/pull_docker_image
Expand All @@ -30,9 +31,11 @@ jobs:
uses: ./.github/actions/build
with:
docker_image: ${{ inputs.docker_image }}
workspace_path: ${{ steps.sync.outputs.workspace_path }}

- name: Create file list for artifacts upload
run: |
cd ${{ steps.sync.outputs.workspace_path }}
touch ../artifacts/file_list.txt
tar -cJf modules.tar.xz ../kobj/tar-install/lib/modules/
echo "modules.tar.xz" >> ../artifacts/file_list.txt
Expand All @@ -44,13 +47,12 @@ jobs:
uses: ./.github/actions/aws_s3_helper
with:
s3_bucket: qli-prd-kernel-gh-artifacts
aws_access_key_id: ${{ secrets.AWSKEYID }}
aws_secret_access_key: ${{ secrets.AWSACCESSKEY }}
local_file: ../artifacts/file_list.txt
local_file: ${{ steps.sync.outputs.workspace_path }}/../artifacts/file_list.txt
mode: multi-upload

- name: Clean up
run: |
cd ${{ steps.sync.outputs.workspace_path }}
rm -rf ../artifacts
rm -rf ../kobj
rm -rf modules.tar.xz
Expand All @@ -68,7 +70,6 @@ jobs:
fi
SUMMARY='
<details><summary><i>Build Summary</i></summary>

'${summary}'
</details>
'
Expand Down
Loading