forked from linux-kdevops/linux-fork-for-kpd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
181 lines (158 loc) · 5.9 KB
/
action.yml
File metadata and controls
181 lines (158 loc) · 5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# SPDX-License-Identifier: GPL-2.0
---
name: Setup kdevops
description: Setup kdevops workspace
inputs:
dir:
description: 'Directory'
required: true
default: 'workdir'
kernel_tree:
required: false
type: string
default: 'linux'
kernel_ref:
required: false
type: string
default: 'master'
ci_workflow:
required: false
type: string
default: 'demo'
runs:
using: "composite"
steps:
- name: Create workspace directory
shell: bash
run: |
pwd
rm --recursive --force --verbose ${{ inputs.dir }}
mkdir --parent --verbose ${{ inputs.dir }}
find .
- name: Configure git
shell: bash
run: |
git config --global --add safe.directory '*'
git config --global user.name "kdevops"
git config --global user.email "kdevops@lists.linux.dev"
- name: Checkout kdevops
working-directory: ${{ inputs.dir }}
shell: bash
run: |
rm --recursive --force --verbose kdevops/
git clone https://github.com/dkruces/kdevops.git --branch ci-workflow kdevops
- name: Checkout custom branch with delta on kdevops/linux
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
set -euxo pipefail
LINUX_TREE="/mirror/${{ inputs.kernel_tree }}.git"
LINUX_TREE_REF="${{ inputs.kernel_ref }}"
git clone $LINUX_TREE linux
cd linux
git checkout $LINUX_TREE_REF
git log -1
- name: Make sure our repo kdevops defconfig exists
id: defconfig
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
set -euxo pipefail
if [[ -z "${{ inputs.kdevops_defconfig }}" ]]; then
KDEVOPS_DEFCONFIG=${{ inputs.ci_workflow }}
else
KDEVOPS_DEFCONFIG="${{ inputs.kdevops_defconfig }}"
fi
if [[ ! -f defconfigs/$KDEVOPS_DEFCONFIG ]]; then
echo "kdevops lacks a defconfig for this repository, expected to find: defconfigs/$KDEVOPS_DEFCONFIG"
exit 1
fi
"${{ github.workspace }}/scripts/github_output.sh" KDEVOPS_DEFCONFIG "$KDEVOPS_DEFCONFIG"
- name: Initialize CI metadata for kdevops-results-archive for linux
id: metadata
working-directory: ${{ inputs.dir }}/kdevops/linux
shell: bash
run: |
set -euxo pipefail
echo "${{ inputs.kernel_tree }}" > ../ci.trigger
echo "testing" > ../ci.subject
echo "${{ inputs.kernel_ref }}" > ../ci.ref
RELEVANT_GIT_TAG=$(cat ../ci.ref)
RELEVANT_GIT_REF=$(git rev-parse --short=12 $RELEVANT_GIT_TAG)
"${{ github.workspace }}/scripts/github_output.sh" LINUX_GIT_REF "$RELEVANT_GIT_REF"
"${{ github.workspace }}/scripts/github_output.sh" LINUX_GIT_TAG "$RELEVANT_GIT_TAG"
# Start out pessimistic
echo "unknown" > ../ci.result
echo "Nothing to write home about." > ../ci.commit_extra
- name: Run a quick Linux kernel defconfig build test
working-directory: ${{ inputs.dir }}/kdevops/linux
env:
LINUX_GIT_TAG: ${{ steps.metadata.outputs.LINUX_GIT_TAG }}
shell: bash
run: |
set -euxo pipefail
git reset --hard "$LINUX_GIT_TAG"
make defconfig
make -j$(nproc)
- name: Run kdevops make defconfig-repo
working-directory: ${{ inputs.dir }}/kdevops
env:
LINUX_GIT_TAG: ${{ steps.metadata.outputs.LINUX_GIT_TAG }}
LINUX_GIT_REF: ${{ steps.metadata.outputs.LINUX_GIT_REF }}
KDEVOPS_DEFCONFIG: ${{ steps.defconfig.outputs.KDEVOPS_DEFCONFIG }}
shell: bash
run: |
LINUX_TREE="/mirror/${{ inputs.kernel_tree }}.git"
LINUX_TREE_REF="$LINUX_GIT_TAG"
# We make the compromise here to use a relevant git tag for the
# host prefix so that folks can easily tell what exact kernel tree
# is being tested by using the relevant git ref. That is, if you
# pushed a tree with the .github/ directory as the top of the tree,
# that commit will not be used, we'll use the last one as that is
# the relevant git ref we want to annotate a test for.
#
# The compromise here is that we expect no two same identical tests
# on the same self-hosted server. We could extend this with something
# like github.run_id but its not yet clear if we can have kdevops
# hosts with a bundled prefix ID like that ref-runid-testname. Tests
# have been done with the full lenght sha1sum though and we know that
# does work.
KDEVOPS_HOSTS_PREFIX="$LINUX_GIT_REF"
echo "Going to use defconfig-$KDEVOPS_DEFCONFIG"
echo "Linux tree: $LINUX_TREE"
echo "Linux trigger ref: $LINUX_TREE_REF"
echo "Linux tag: $LINUX_GIT_TAG"
echo "Runner ID: ${{ github.run_id }}"
echo "kdevops host prefix: $KDEVOPS_HOSTS_PREFIX"
echo "kdevops defconfig: defconfig-$KDEVOPS_DEFCONFIG"
KDEVOPS_ARGS="\
KDEVOPS_HOSTS_PREFIX=$KDEVOPS_HOSTS_PREFIX \
LINUX_TREE=$LINUX_TREE \
LINUX_TREE_REF=$LINUX_TREE_REF \
ANSIBLE_CFG_CALLBACK_PLUGIN="debug" \
defconfig-$KDEVOPS_DEFCONFIG"
echo "Going to run:"
echo "make $KDEVOPS_ARGS"
make $KDEVOPS_ARGS
- name: Run kdevops make
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
make -j$(nproc)
- name: Run kdevops make bringup
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
ls -ld linux
make destroy
make bringup
- name: Build linux and boot test nodes on test kernel
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
make linux
- name: Build required ci tests
working-directory: ${{ inputs.dir }}/kdevops
shell: bash
run: |
make ci-build-test CI_WORKFLOW=${{ inputs.ci_workflow }}