Skip to content

Commit

Permalink
Merge pull request #54 from lecopzer/fix_travis
Browse files Browse the repository at this point in the history
CI: Avoid misusage in matrix
  • Loading branch information
jserv authored Mar 24, 2018
2 parents d68fe3d + d05be8b commit 6aaed00
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
30 changes: 17 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
sudo: required
dist: trusty
os: linux
language: python
python:
- "3.5"
- "3.6"

cache: pip
stage:
- docs
- core

matrix:
fast_finish: true
jobs:
include:
- os: linux
- stage: docs
env: TESTING=docs
language: python
python: 3.6
before_install:
- sudo apt-get update -qq
install:
- sudo apt-get install cscope
before_script:
- cd docs
- pip install sphinx
script:
- make check
- make html
- os: linux
- &core-stage
stage: core
python: 3.5
env: TESTING=Piko/RT
language: c
compiler: arm-none-eabi-gcc

before_install:
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
- sudo apt-get update -qq
Expand All @@ -37,9 +38,12 @@ matrix:
- sudo apt install genromfs
- wget https://github.com/PikoRT/tools/raw/master/bin/x86_64-linux/qemu-system-arm
- chmod 777 qemu-system-arm
- export PATH=$PATH:$PWD
- export PATH=$PWD:$PATH
before_script:
- arm-none-eabi-gcc --version
- python --version
script:
- make PLAT=stm32p103
- make PLAT=stm32p103 check
- <<: *core-stage
python: 3.6
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ OBJS := $(sort $(OBJS))

deps := $(OBJS:%.o=.%.o.d)

.PHONY: all check clean distclean
.PHONY: all check clean distclean check_cc

all: $(CMSIS)/$(PLAT) $(NAME).lds $(NAME).bin
all: check_cc $(CMSIS)/$(PLAT) $(NAME).lds $(NAME).bin

# generic build rules
include mk/flags.mk
Expand All @@ -48,9 +48,17 @@ include mk/cmsis.mk

prebuild: $(CMSIS)/$(PLAT)

check:
check: check_cc
$(PYTHON) -m tests -p $(PLAT) --qemu $(QEMU_SYSTEM_ARM) --cc $(CC)

check_cc:
@$(eval PYTHON_VERSION=$(shell echo `$(PYTHON) --version 2>&1 | grep -oE '[^ ]+$$'`))
@$(eval PYTHON_VERSION=$(shell echo $(PYTHON_VERSION) | awk -F "." '{print $$1$$2 0}'))
@if [ $(PYTHON_VERSION) -lt 350 ]; then \
echo "Error: Python version must >= 3.5, use PYTHON=/python/binary/path"; \
return 1;\
fi;

clean:
find . -name "*.o" -type f -delete
find . -name "*.o.d" -type f -delete
Expand Down
3 changes: 1 addition & 2 deletions mk/flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
GDB = $(CROSS_COMPILE)gdb
HOSTCC = gcc
WGET = wget
# FIXME: check version >= 3.5
PYTHON = python3
PYTHON ?= python
QEMU_SYSTEM_ARM ?= qemu-system-arm

# FIXME: configurable via menuconfig or command line
Expand Down

0 comments on commit 6aaed00

Please sign in to comment.