forked from facebook/openbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (87 loc) · 2.87 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
dist: bionic # has python3.6 by default (needed by black)
language: c
git:
# Need some depth to get the common ancestor
# 50 should be sufficient, otherwise you need to rebase.
depth: 50
addons:
apt:
update: true
packages:
- python3-setuptools # needed by pip
- python3-pip
- build-essential
- wget
- diffstat
- chrpath
- texinfo
- bzip2
- libthread-queue-perl
stages:
- lint
- test # actually, this is the "build" stage
# (defined in the job matrix ("env.matrix" and "script" root node)
# https://docs.travis-ci.com/user/build-stages/#specifying-stage-order-and-conditions)
# Pre-build jobs (e.g. linting, unit testing)
jobs:
include:
- stage: lint
env: BOARD='<BASH LINT>'
script:
- "if [[ $MODIFIED_SH ]]; then shellcheck $MODIFIED_SH; fi"
- env: BOARD='<PYTHON LINT>'
script:
- "python3 -m pip install black==19.3b0"
- "python3 -m black --diff --check $MODIFIED_PY"
# Due to travis ci weirdness, we don't include the build job matrix in the "jobs"
# section above, but do it separately here.
# https://docs.travis-ci.com/user/build-stages/matrix-expansion/
env:
global:
# ORIGIN_COMMIT has first commit that branched out from master. We want this to find all
# files that were modified since the branch out from master (i.e. all files in a given
# pull request).
# Initially thought that was achievable using $TRAVIS_COMMIT_RANGE, but that only
# gets you the commits that changed since the last _push_, not all commits from a given
# pull request (which can lead to lint errors disappearing by pushing something
# completely unrelated)
- ORIGIN_COMMIT=$(git merge-base HEAD origin/helium 2>/dev/null || git merge-base HEAD origin/master)
- CACHE="${HOME}/sstate-cache"
- CACHE_URI="https://fb-openbmc-sstate.s3.us-east-2.amazonaws.com"
- MODIFIED_SH="$(git diff --diff-filter=d --name-only $ORIGIN_COMMIT -- | grep -P '[.]sh$')"
- MODIFIED_PY="$(git diff --diff-filter=d --name-only $ORIGIN_COMMIT -- | grep -P '[.]py$')"
matrix:
- BOARD=angelslanding
- BOARD=cloudripper
- BOARD=cmm
- BOARD=emeraldpools
- BOARD=clearcreek
- BOARD=cloudripper
- BOARD=elbert
- BOARD=fbgp2
- BOARD=fbtp
- BOARD=fbttn
- BOARD=fby2
- BOARD=fby3
- BOARD=fuji
- BOARD=galaxy100
- BOARD=grandcanyon
- BOARD=lightning
- BOARD=minipack
- BOARD=northdome
- BOARD=sonorapass
- BOARD=wedge
- BOARD=wedge100
- BOARD=wedge400
- BOARD=yamp
- BOARD=yosemite
script:
# Sync Yocto meta-repositories.
- ./sync_yocto.sh
# Set up bitbake build environment.
- source ./openbmc-init-build-env ${BOARD} build-${BOARD}
- source ../tools/travis/check-build-required
# Set up sstate cache.
- ../tools/travis/download-sstate-cache
# Do the build.
- ../tools/travis/do-build