Skip to content

Commit 8fbd00d

Browse files
authored
Merge pull request torvalds#395 from tavip/lkl-fix-circle-ci
A few fixes and improvements for circleci
2 parents 52a6a64 + 2a0c8e2 commit 8fbd00d

File tree

2 files changed

+95
-131
lines changed

2 files changed

+95
-131
lines changed

.circleci/config.yml

Lines changed: 94 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -2,168 +2,140 @@ version: 2
22
general:
33
artifacts:
44

5+
do_steps: &do_steps
6+
steps:
7+
- run: echo "$CROSS_COMPILE" > ~/_cross_compile
8+
- restore_cache:
9+
key: code-tree-shallow
10+
- run:
11+
name: checkout build tree
12+
command: |
13+
mkdir -p ~/.ssh/
14+
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
15+
if ! [ -d .git ]; then
16+
git clone --depth=1 $CIRCLE_REPOSITORY_URL .;
17+
fi
18+
if [[ $CIRCLE_BRANCH == pull/* ]]; then
19+
git fetch --depth=1 origin $CIRCLE_BRANCH/head;
20+
else
21+
git fetch --depth=1 origin $CIRCLE_BRANCH;
22+
fi
23+
git reset --hard $CIRCLE_SHA1
24+
- save_cache:
25+
key: code-tree-shallow-{{ epoch }}
26+
paths:
27+
- /home/ubuntu/project/.git
28+
- run: cd tools/lkl && make clean
29+
- run: mkdir -p /home/ubuntu/.ccache
30+
- restore_cache:
31+
key: compiler-cache-{{ checksum "~/_cross_compile" }}
32+
- run:
33+
name: build DPDK
34+
command: |
35+
if [ "$MKARG" = "dpdk=yes" ]; then
36+
sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r)
37+
cd tools/lkl && ./scripts/dpdk-sdk-build.sh;
38+
fi
39+
- run:
40+
name: copy mingw binutils
41+
command: |
42+
if [ "$CROSS_COMPILE" = "i686-w64-mingw32-" ]; then
43+
sudo cp tools/lkl/bin/i686-w64-mingw32-* /usr/bin;
44+
fi
45+
- run:
46+
name: start android emulator
47+
command: |
48+
if [[ $CROSS_COMPILE == *android* ]]; then
49+
emulator -avd Nexus5_API24 -no-window -no-audio -no-boot-anim;
50+
fi
51+
background: true
52+
- run: cd tools/lkl && make -j8 ${MKARG}
53+
- save_cache:
54+
paths:
55+
- /home/ubuntu/.ccache
56+
key: compiler-cache-{{ checksum "~/_cross_compile" }}-{{ epoch }}
57+
- run:
58+
name: wait android emulator to boot
59+
command: |
60+
if [[ $CROSS_COMPILE == *android* ]]; then
61+
/home/ubuntu/circle-android.sh wait-for-boot;
62+
fi
63+
- run: cd tools/lkl && make test
64+
- run: if [ $VALGRIND = 1]; then cd tools/lkl && make valgrind; fi
65+
- run:
66+
name: save test results
67+
command: |
68+
mkdir -p ~/junit/
69+
find ./tools/lkl/ -type f -name "*.xml" -exec cp {} ~/junit/ \;
70+
when: always
71+
- store_test_results:
72+
path: ~/junit
73+
- store_artifacts:
74+
path: ~/junit
75+
576
## Customize the test machine
677
jobs:
778
x86_64:
879
docker:
9-
- image: thehajime/lkl-docker:1.1
80+
- image: lkldocker/circleci-x86_64:0.1
1081
environment:
1182
CROSS_COMPILE: ""
1283
MKARG: "dpdk=yes"
1384
LKL_TEST_DHCP: 1
14-
steps:
15-
- run: mkdir -p /home/ubuntu/.ccache
16-
- restore_cache:
17-
key: compiler-cache0
18-
# speed up `git clone` instead of `checkout`
19-
- run:
20-
name: checkout build tree
21-
command: |
22-
mkdir -p ~/.ssh/
23-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
24-
git clone --depth=1 --branch $CIRCLE_BRANCH --single-branch $CIRCLE_REPOSITORY_URL .
25-
git reset --hard $CIRCLE_SHA1
26-
- run: cd tools/lkl && make clean
27-
- run: sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r)
28-
- run: cd tools/lkl && ./scripts/dpdk-sdk-build.sh
29-
- run: cd tools/lkl && make -j8 ${MKARG}
30-
- run: cd tools/lkl && make test
31-
- save_cache:
32-
key: compiler-cache0-{{ checksum "~/project/tools/lkl/liblkl-hijack.so" }}
33-
paths:
34-
- /home/ubuntu/.ccache
85+
<<: *do_steps
3586

3687
mingw32:
3788
docker:
38-
- image: thehajime/lkl-docker:1.1
89+
- image: lkldocker/circleci-mingw:0.1
3990
environment:
4091
CROSS_COMPILE: "i686-w64-mingw32-"
4192
LKL_TEST_DHCP: 1
42-
steps:
43-
- run: mkdir -p /home/ubuntu/.ccache
44-
- restore_cache:
45-
key: compiler-cache1
46-
- restore_cache:
47-
key: code-tree
48-
- checkout
49-
- save_cache:
50-
key: code-tree
51-
paths:
52-
- /home/ubuntu/project/.git
53-
- run: sudo cp tools/lkl/bin/i686-w64-mingw32-* /usr/bin
54-
- run: cd tools/lkl && make clean
55-
- run: cd tools/lkl && make -j8 ${MKARG}
56-
- run: cd tools/lkl && make test
57-
- run: git fetch --tags git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
58-
- run: tools/lkl/scripts/checkpatch.sh
59-
- save_cache:
60-
key: compiler-cache1-{{ checksum "~/project/tools/lkl/liblkl.dll" }}
61-
paths:
62-
- /home/ubuntu/.ccache
93+
<<: *do_steps
6394

6495
android-arm32:
6596
docker:
66-
- image: thehajime/lkl-docker:1.1
97+
- image: lkldocker/circleci-android-arm32:0.1
6798
environment:
6899
CROSS_COMPILE: "arm-linux-androideabi-"
69100
LKL_TEST_DHCP: 1
70101
LKL_ANDROID_TEST: 1
71102
ANDROID_SDK_ROOT: /home/ubuntu/android-sdk
72-
steps:
73-
- run: mkdir -p /home/ubuntu/.ccache
74-
- restore_cache:
75-
key: compiler-cache2
76-
# speed up `git clone` instead of `checkout`
77-
- run:
78-
name: checkout build tree
79-
command: |
80-
mkdir -p ~/.ssh/
81-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
82-
git clone --depth=1 --branch $CIRCLE_BRANCH --single-branch $CIRCLE_REPOSITORY_URL .
83-
git reset --hard $CIRCLE_SHA1
84-
- run: cd tools/lkl && make clean
85-
- run: cd tools/lkl && make -j8 ${MKARG}
86-
- run:
87-
command: emulator -avd Nexus5_API24 -no-window
88-
background: true
89-
- run: /home/ubuntu/circle-android.sh wait-for-boot
90-
- run: cd tools/lkl && make test
91-
- save_cache:
92-
key: compiler-cache2-{{ checksum "~/project/tools/lkl/liblkl-hijack.so" }}
93-
paths:
94-
- /home/ubuntu/.ccache
103+
<<: *do_steps
95104

96105
android-aarch64:
97106
docker:
98-
- image: thehajime/lkl-docker:1.1
107+
- image: lkldocker/circleci-android-arm64:0.1
99108
environment:
100109
CROSS_COMPILE: "aarch64-linux-android-"
101110
LKL_TEST_DHCP: 1
102111
LKL_ANDROID_TEST: 1
103112
ANDROID_SDK_ROOT: /home/ubuntu/android-sdk
104-
steps:
105-
- run: mkdir -p /home/ubuntu/.ccache
106-
- restore_cache:
107-
key: compiler-cache3
108-
# speed up `git clone` instead of `checkout`
109-
- run:
110-
name: checkout build tree
111-
command: |
112-
mkdir -p ~/.ssh/
113-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
114-
git clone --depth=1 --branch $CIRCLE_BRANCH --single-branch $CIRCLE_REPOSITORY_URL .
115-
git reset --hard $CIRCLE_SHA1
116-
- run: cd tools/lkl && make clean
117-
- run: cd tools/lkl && make -j8 ${MKARG}
118-
- run:
119-
command: emulator -avd Nexus5X_API24 -no-window
120-
background: true
121-
- run: /home/ubuntu/circle-android.sh wait-for-boot
122-
- run: cd tools/lkl && make test
123-
- save_cache:
124-
key: compiler-cache3-{{ checksum "~/project/tools/lkl/liblkl-hijack.so" }}
125-
paths:
126-
- /home/ubuntu/.ccache
113+
<<: *do_steps
127114

128115
x86_64_valgrind:
129116
docker:
130-
- image: thehajime/lkl-docker:1.1
117+
- image: lkldocker/circleci-x86_64:0.1
131118
environment:
132119
CROSS_COMPILE: ""
133120
MKARG: "dpdk=yes"
134121
LKL_TEST_DHCP: 1
122+
VALGRIND: 1
123+
<<: *do_steps
124+
125+
checkpatch:
126+
docker:
127+
- image: lkldocker/circleci:0.1
128+
environment:
135129
steps:
136-
- run: mkdir -p /home/ubuntu/.ccache
137130
- restore_cache:
138-
key: compiler-cache4
139-
# speed up `git clone` instead of `checkout`
140-
- run:
141-
name: checkout build tree
142-
command: |
143-
mkdir -p ~/.ssh/
144-
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
145-
git clone --depth=1 --branch $CIRCLE_BRANCH --single-branch $CIRCLE_REPOSITORY_URL .
146-
git reset --hard $CIRCLE_SHA1
147-
- run: cd tools/lkl && make clean
148-
- run: sudo apt-get update && sudo apt-get install -y linux-headers-$(uname -r)
149-
- run: cd tools/lkl && ./scripts/dpdk-sdk-build.sh
150-
- run: cd tools/lkl && make -j8 ${MKARG}
151-
- run: cd tools/lkl && make test
152-
- run: cd tools/lkl && make valgrind
153-
- run:
154-
name: Save test results
155-
command: |
156-
mkdir -p ~/junit/
157-
find ./tools/lkl/ -type f -name "*.xml" -exec cp {} ~/junit/ \;
158-
when: always
159-
- store_test_results:
160-
path: ~/junit
161-
- store_artifacts:
162-
path: ~/junit
131+
key: code-tree-full-history
132+
- checkout
133+
- run: tools/lkl/scripts/checkpatch.sh
163134
- save_cache:
164-
key: compiler-cache4-{{ checksum "~/project/tools/lkl/liblkl-hijack.so" }}
135+
key: code-tree-full-history-{{ epoch }}
165136
paths:
166-
- /home/ubuntu/.ccache
137+
- /home/ubuntu/project/.git
138+
when: always
167139

168140
workflows:
169141
version: 2
@@ -173,3 +145,4 @@ workflows:
173145
- mingw32
174146
- android-arm32
175147
- android-aarch64
148+
- checkpatch

tools/lkl/scripts/checkpatch.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
#!/bin/sh -ex
22

3-
# Sometime we might want to skip certain checkpatch.pl errors
4-
# (e.g. when trying to preserve existing code style that checkpatch.pl
5-
# complains about). In that case just add a new variable in the
6-
# CircleCI project settings and rebuild. Don't forget to remove them
7-
# after restarting the build.
8-
if [ -n "$SKIP_CHECKPATCH" ]; then
9-
exit 0
10-
fi
11-
123
if [ -z "$origin_master" ]; then
134
origin_master="origin/master"
145
fi
@@ -20,7 +11,7 @@ upstream=`git remote -v | grep $UPSTREAM | cut -f1 | head -n1`
2011
lkl=`git remote -v | grep $LKL | cut -f1 | head -n1`
2112

2213
if [ -z "$upstream" ]; then
23-
git fetch --tags --progress http://$UPSTREAM
14+
git fetch --tags --progress git://$UPSTREAM
2415
else
2516
git fetch --tags $upstream
2617
fi

0 commit comments

Comments
 (0)