Skip to content

Commit cc2d5e7

Browse files
committed
adding ci files
1 parent 84b4a51 commit cc2d5e7

1 file changed

Lines changed: 143 additions & 0 deletions

File tree

.github/workflows/kdevops.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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: Make sure our repo kdevops defconfig exists
30+
run: |
31+
KDEVOPS_DEFCONFIG=$(echo $(basename ${{ github.repository }}))
32+
cd kdevops
33+
if [[ ! -f defconfigs/$KDEVOPS_DEFCONFIG ]]; then
34+
echo "kdevops lacks a defconfig for this repository, expected to find: defconfigs/$KDEVOPS_DEFCONFIG"
35+
exit 1
36+
fi
37+
38+
- name: Initialize CI metadata for kdevops-results-archive
39+
run: |
40+
cd kdevops
41+
echo "$(basename ${{ github.repository }})" > ci.trigger
42+
git log -1 --pretty=format:"%s" > ci.subject
43+
# Start out pessimistic
44+
echo "not ok" > ci.result
45+
echo "Nothing to write home about." > ci.commit_extra
46+
47+
- name: Checkout custom branch with delta on kdevops/linux
48+
run: |
49+
LINUX_TREE="https://github.com/${{ github.repository }}"
50+
LINUX_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
51+
cd kdevops
52+
git clone $LINUX_TREE --reference /mirror/linux.git/ --depth=5 linux
53+
cd linux
54+
git fetch origin $LINUX_TREE_REF
55+
git checkout $LINUX_TREE_REF
56+
git log -1
57+
58+
- name: Run a quick Linux kernel defconfig build test
59+
run: |
60+
cd kdevops/linux
61+
make defconfig
62+
make -j$(nproc)
63+
64+
- name: Run kdevops make defconfig-repo
65+
run: |
66+
LINUX_TREE="https://github.com/${{ github.repository }}"
67+
LINUX_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
68+
KDEVOPS_DEFCONFIG=$(echo $(basename ${{ github.repository }}))
69+
KDEVOPS_HOSTS_PREFIX="$(echo ${LINUX_TREE_REF:0:4})"
70+
echo Going to use defconfig-$(basename ${{ github.repository }})
71+
72+
echo "Linux tree: $LINUX_TREE"
73+
echo "Linux ref: $LINUX_TREE_REF"
74+
echo "Runner ID: ${{ github.run_id }}"
75+
echo "kdevops host prefix: $KDEVOPS_HOSTS_PREFIX"
76+
77+
KDEVOPS_ARGS="KDEVOPS_HOSTS_PREFIX=$KDEVOPS_HOSTS_PREFIX LINUX_TREE=$LINUX_TREE LINUX_TREE_REF=$LINUX_TREE_REF defconfig-$KDEVOPS_DEFCONFIG"
78+
echo Going to run:
79+
echo make $KDEVOPS_ARGS
80+
81+
cd kdevops
82+
make $KDEVOPS_ARGS
83+
84+
- name: Run kdevops make
85+
run: |
86+
cd kdevops
87+
make -j$(nproc)
88+
89+
- name: Run kdevops make bringup
90+
run: |
91+
cd kdevops
92+
ls -ld linux
93+
make bringup
94+
95+
- name: Build linux and boot test nodes on test kernel
96+
run: |
97+
cd kdevops
98+
make linux
99+
100+
- name: Build required ci tests
101+
run: |
102+
cd kdevops
103+
make ci-build-test
104+
105+
- name: Run CI tests
106+
run: |
107+
cd kdevops
108+
make ci-test
109+
echo "ok" > ci.result
110+
111+
- name: Get systemd journal files
112+
if: always() # This ensures the step runs even if previous steps failed
113+
run: |
114+
cd kdevops
115+
make journal-dump
116+
117+
- name: Start SSH Agent
118+
if: always() # Ensure this step runs even if previous steps failed
119+
uses: webfactory/ssh-agent@v0.9.0
120+
with:
121+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
122+
123+
- name: Build our kdevops archive results
124+
if: always() # This ensures the step runs even if previous steps failed
125+
run: |
126+
cd kdevops
127+
make ci-archive
128+
129+
- name: Upload our kdevops results archive
130+
if: always() # This ensures the step runs even if previous steps failed
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: kdevops-ci-results
134+
path: ${{ env.LINUX_KDEVOPS_PATH }}/kdevops/archive/*.zip
135+
136+
# Ensure make destroy always runs, even on failure
137+
- name: Run kdevops make destroy
138+
if: always() # This ensures the step runs even if previous steps failed
139+
run: |
140+
cd kdevops
141+
make destroy
142+
cd ..
143+
rm -rf kdevops

0 commit comments

Comments
 (0)