forked from thesofproject/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
134 lines (126 loc) · 5.56 KB
/
.travis.yml
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
---
# Suggested tools that can save round-trips to github and a lot of time:
#
# yamllint .travis.yml
# ~/.gem/ruby/2.7.0/bin/travis lint .travis.yml
# yaml merge-expand .travis.yml exp.yml && diff -b -u .travis.yml exp.yml
language: c
dist: focal
# The git depth parameter requires a very fine balance for large repos with
# many merges like the Linux kernel.
#
# - When it's too deep it won't save much time because the number of
# commits is an approximately exponential function of depth because of
# the very frequent merges.
#
# - When it's too shallow it will save zero time because fetching pull
# requests with a base older than the shallow history will take as
# much time as cloning the entire repo... without even providing the
# entire repo information as checkpatch seems to be producing very
# confusing garbage in that case. See example and discussion in
# https://github.com/thesofproject/linux/pull/2341
# (The workaround is of course to rebase the pull request)
git:
depth: 20
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y python-ply libelf-dev codespell fakeroot gcc g++ gcc-aarch64-linux-gnu
- sudo apt-get install -y clang-format clang-tidy clang-tools clang clangd
- sudo apt-get install -y xz-utils lftp
install:
- git clone --depth 5 https://github.com/thesofproject/kconfig.git
- pushd kconfig
- &short_log git --no-pager log --oneline --graph --decorate --max-count=5
- popd
- mkdir 0day
- wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O make.cross
- chmod +x make.cross
- mkdir -p $PWD/bin
- git clone --depth 1 --branch v0.6.2 git://git.kernel.org/pub/scm/devel/sparse/sparse.git
- BINDIR=$PWD/bin make -C sparse install
- export PATH=$PWD/bin:$PATH
- nproc # should be 2 according to https://docs.travis-ci.com/user/reference/overview/#virtualization-environments
jobs:
include:
- if: type = pull_request
# These two are combined because they both need a merge base and
# locally unshallowing .git/ seems time consuming for some reason.
# Without the merge base, the --xxxstats will either fail or be
# wrong and checkpatch prints confusing garbage.
name: checkpatch and age of git base
script:
# Start with some visual and plain English context. A picture is
# worth thousand words and makes all the rest less abstract.
- *short_log
- git --no-pager log --oneline --graph --decorate
--max-count=5 "${TRAVIS_BRANCH}"
# If the merge base is missing then the shallow depth
# optimization has _already_ failed because Travis' already
# fetched practically the entire history with a "git fetch
# github pulls/1234/merge" command. The very long duration of
# that earlier fetch merge command is hidden in Travis logs
# under the git clone command _wrongly_ advertised as quick!
- git merge-base "${TRAVIS_PULL_REQUEST_SHA}" "${TRAVIS_BRANCH}" ||
git fetch --unshallow https://github.com/"${TRAVIS_REPO_SLUG}"
"${TRAVIS_BRANCH}"
# Show how "late" the PR base is
- |
# Tests are run on the PR merged with this extra code from the
# (moving) target branch:
git diff --shortstat --dirstat \
"${TRAVIS_PULL_REQUEST_SHA}"..."${TRAVIS_BRANCH}"
# Use set -x to expand all values in the log.
# No double dot '..' so rev-list fails if a TRAVIS_ variable is missing
- set -x; behind=$(git rev-list --no-merges
^"${TRAVIS_PULL_REQUEST_SHA}" "${TRAVIS_BRANCH}" | wc -l) ; set +x
# Note $behind is NOT comparable to clone depth in repos with merges.
- '[ "$behind" -lt 1000 ] # is the PR base too far behind?'
# New Ubuntu 20.04 location
- sudo mkdir -p /usr/share/codespell && sudo ln -s
/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt
/usr/share/codespell/dictionary.txt
# Note TRAVIS_COMMIT_RANGE has triple dots for "git diff" and
# needs conversion to double dots for git log's inconsistent
# user interface.
- ( set -x; scripts/checkpatch.pl --strict --codespell
-g "${TRAVIS_COMMIT_RANGE/.../..}" )
- name: Sparse check
script:
- export ARCH=x86_64
- bash kconfig/kconfig-sof-default.sh
- make modules_prepare
- make M=sound/soc/sof C=2
- name: "BUILD GCC9 SOF Kernel x86_64"
script:
- export ARCH=x86_64 KCFLAGS="-Wall -Werror"
- export MAKEFLAGS=j"$(nproc)"
- bash kconfig/kconfig-sof-default.sh
- make sound/ W=1
- make drivers/soundwire/ W=1
- make
- make bindeb-pkg
- name: "BUILD GCC9 SOF Kernel i386"
script:
- export ARCH=i386 KCFLAGS="-Wall -Werror"
- export MAKEFLAGS=j"$(nproc)"
- bash kconfig/kconfig-sof-default.sh
- make sound/
- make drivers/soundwire/
- make
- name: "BUILD GCC9 SOF Kernel arm64"
script:
- export ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- KCFLAGS="-Wall -Werror"
- export MAKEFLAGS=j"$(nproc)"
- bash kconfig/kconfig-sof-arm64.sh
- make sound/
- make drivers/soundwire/
- make
- name: "BUILD CLANG SOF Kernel x86_64"
script:
- export ARCH=x86_64 CC=clang KCFLAGS="-Wall -Werror"
- export MAKEFLAGS=j"$(nproc)"
- bash kconfig/kconfig-sof-default.sh
- make olddefconfig
- make sound/
- make drivers/soundwire/
- make