Skip to content

Commit 800bb0b

Browse files
committed
adding ci files
1 parent 2295cf8 commit 800bb0b

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed

.github/workflows/kdevops.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Run generic kdevops CI runner workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
workflow_dispatch: # Add this for manual triggering of the workflow
11+
12+
jobs:
13+
run-kdevops:
14+
name: Run kdevops CI on Self-hosted Runner
15+
runs-on: [self-hosted, Linux, X64]
16+
steps:
17+
- name: Configure git
18+
run: |
19+
git config --global --add safe.directory '*'
20+
21+
- name: Set Linux kdevops development path
22+
run: echo "LINUX_KDEVOPS_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
23+
24+
- name: Checkout kdevops
25+
run: |
26+
rm -rf kdevops
27+
git clone /mirror/kdevops.git kdevops
28+
29+
- name: Checkout custom branch with delta on kdevops/linux
30+
run: |
31+
LINUX_TREE="https://github.com/${{ github.repository }}"
32+
LINUX_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
33+
cd kdevops
34+
git clone $LINUX_TREE --reference /mirror/linux.git/ --depth=5 linux
35+
cd linux
36+
git fetch origin $LINUX_TREE_REF
37+
git checkout $LINUX_TREE_REF
38+
git log -1
39+
40+
- name: Run a quick Linux kernel defconfig build test
41+
run: |
42+
cd kdevops/linux
43+
make defconfig
44+
make -j$(nproc)
45+
46+
- name: Make sure our repo kdevops defconfig exists
47+
run: |
48+
KDEVOPS_DEFCONFIG=$(echo $(basename ${{ github.repository }}))
49+
cd kdevops
50+
if [[ ! -f defconfigs/$KDEVOPS_DEFCONFIG ]]; then
51+
echo "kdevops lacks a defconfig for this repository, expected to find: defconfigs/$KDEVOPS_DEFCONFIG"
52+
exit 1
53+
fi
54+
55+
- name: Run kdevops make defconfig-repo
56+
run: |
57+
LINUX_TREE="https://github.com/${{ github.repository }}"
58+
LINUX_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
59+
KDEVOPS_DEFCONFIG=$(echo $(basename ${{ github.repository }}))
60+
KDEVOPS_HOSTS_PREFIX="$(echo ${LINUX_TREE_REF:0:4})"
61+
echo Going to use defconfig-$(basename ${{ github.repository }})
62+
63+
echo "Linux tree: $LINUX_TREE"
64+
echo "Linux ref: $LINUX_TREE_REF"
65+
echo "Runner ID: ${{ github.run_id }}"
66+
echo "kdevops host prefix: $KDEVOPS_HOSTS_PREFIX"
67+
68+
KDEVOPS_ARGS="KDEVOPS_HOSTS_PREFIX=$KDEVOPS_HOSTS_PREFIX LINUX_TREE=$LINUX_TREE LINUX_TREE_REF=$LINUX_TREE_REF defconfig-$KDEVOPS_DEFCONFIG"
69+
echo Going to run:
70+
echo make $KDEVOPS_ARGS
71+
72+
cd kdevops
73+
make $KDEVOPS_ARGS
74+
75+
- name: Run kdevops make
76+
run: |
77+
cd kdevops
78+
make -j$(nproc)
79+
80+
- name: Run kdevops make bringup
81+
run: |
82+
cd kdevops
83+
ls -ld linux
84+
make bringup
85+
86+
- name: Build linux and boot test nodes on test kernel
87+
run: |
88+
cd kdevops
89+
make linux
90+
91+
- name: Build required ci tests
92+
run: |
93+
cd kdevops
94+
make ci-build-test
95+
96+
- name: Run CI tests
97+
run: |
98+
cd kdevops
99+
make ci-test
100+
101+
- name: Get systemd journal files
102+
if: always() # This ensures the step runs even if previous steps failed
103+
run: |
104+
cd kdevops
105+
make journal-dump
106+
107+
- name: Start SSH Agent
108+
if: always() # Ensure this step runs even if previous steps failed
109+
uses: webfactory/ssh-agent@v0.9.0
110+
with:
111+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
112+
113+
- name: Build our kdevops archive results
114+
if: always() # This ensures the step runs even if previous steps failed
115+
run: |
116+
cd kdevops
117+
make ci-archive
118+
119+
- name: Upload our kdevops results archive
120+
if: always() # This ensures the step runs even if previous steps failed
121+
uses: actions/upload-artifact@v4
122+
with:
123+
name: kdevops-ci-results
124+
path: ${{ env.LINUX_KDEVOPS_PATH }}/kdevops/archive/*.zip
125+
126+
# Ensure make destroy always runs, even on failure
127+
- name: Run kdevops make destroy
128+
if: always() # This ensures the step runs even if previous steps failed
129+
run: |
130+
cd kdevops
131+
make destroy
132+
cd ..
133+
rm -rf kdevops

0 commit comments

Comments
 (0)