Skip to content

Commit

Permalink
.circleci: test for specific Yocto branch
Browse files Browse the repository at this point in the history
Up to now, all tests did simply check out any latest state of all layers
to perform testing. This is sufficient for master in most cases, but
will fail when attempting to test for other releases as it is required
for stable branch updates.

Unfortunately, despite this would be the best reference, currently there
is no way in circleci to determine the actual branch a pull request was
opened against. See also https://ideas.circleci.com/ideas/CCI-I-894

Thus for now, we define the targeted Yocto/poky branch and release
version with environment variables, named 'YOCTO_BRANCH' and
'YOCTO_VERSION'.

With them, the job now clones the exact branches required and also
writes the exact sstate mirror path required into local.conf.

By adapting the environment variable for different stable branches this
potentially allows running tests against the concrete poky version.

Signed-off-by: Enrico Jorns <[email protected]>
  • Loading branch information
ejoerns committed Jan 6, 2020
1 parent 1af6994 commit 2c6baaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ jobs:
docker:
- image: crops/yocto:ubuntu-19.04-builder
environment:
YOCTO_BRANCH: master
YOCTO_VERSION: "3.1"
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
Expand All @@ -18,10 +20,10 @@ jobs:
- sstate-test-
- run:
name: Clone poky
command: git clone git://git.yoctoproject.org/poky
command: git clone -b ${YOCTO_BRANCH} git://git.yoctoproject.org/poky
- run:
name: Clone meta-oe
command: git clone https://github.com/openembedded/meta-openembedded.git meta-oe
command: git clone -b ${YOCTO_BRANCH} https://github.com/openembedded/meta-openembedded.git meta-oe
- run:
name: Link meta-rauc
command: ln -sf . meta-rauc
Expand All @@ -30,7 +32,7 @@ jobs:
command: mkdir -p meta-this/conf/ && cp .circleci/*.sample meta-this/conf/.
- run:
name: Initialize build directory
command: TEMPLATECONF=../meta-this/conf source poky/oe-init-build-env build
command: TEMPLATECONF=../meta-this/conf source poky/oe-init-build-env build && sed -i s/YOCTO_VERSION/${YOCTO_VERSION}/g conf/local.conf && cat conf/local.conf
- run:
name: Build rauc
command: source poky/oe-init-build-env build && bitbake rauc
Expand Down
3 changes: 1 addition & 2 deletions .circleci/local.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ CONF_VERSION = "1"
SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
SSTATE_MIRRORS = "\
file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \
file://.* http://sstate.yoctoproject.org/2.6/PATH;downloadfilename=PATH \n \
file://.* http://sstate.yoctoproject.org/2.7/PATH;downloadfilename=PATH \n \
file://.* http://sstate.yoctoproject.org/YOCTO_VERSION/PATH;downloadfilename=PATH \n \
"

0 comments on commit 2c6baaa

Please sign in to comment.