forked from kiibohd/controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
128 lines (104 loc) · 4.18 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
# travis-ci integration for the kiibohd controller firmware
# XXX Using Ubuntu 14.04 Trusty in root mode (we need universe repo, means we can't use container infra yet)
# Jacob Alexander 2016-2018
sudo: required
dist: xenial
language:
- c
os:
- linux
- osx
compiler:
#- clang
- gcc
# Build Scripts
env:
# Keyboard Tests
- DIR=Keyboards SCRIPT=ic_keyboards.bash # Input Club Keyboards
- DIR=Keyboards SCRIPT=ic_keyboards.bash EnableHostOnlyBuild=true HostTest=kll.py # Input Club Keyboards - Host-Side Build
# Misc Keyboard Tests
- DIR=Keyboards/Others SCRIPT=others.bash
# Debug Build Tests
- DIR=Keyboards/Testing SCRIPT=all_tests.bash
# Bootloader Build Tests
- DIR=Bootloader/Builds SCRIPT=all.bash
# Dockerfile Tests
- DIR=Dockerfiles SCRIPT=all.bash
# Deployment Build
- DIR=Lib/CMake SCRIPT=travis_deploy.bash DEPLOY_NAME=All
# Exclusions
matrix:
# TODO - Still some travis clang issues
allow_failures:
- compiler: clang
# XXX (HaaTa): Docker environment creation is slow causing Travis-CI to halt jobs
# This will need to get fixed
- env: DIR=Dockerfiles SCRIPT=all.bash
exclude:
# Bootloader doesn't support clang yet
- compiler: clang
env: DIR=Bootloader/Builds SCRIPT=all.bash
# xcode *and* brew don't support clang ARMCCompiler for arm-none-eabi, sigh, useless Apple
- compiler: clang
os: osx
# No need to build deployment for macOS
- env: DIR=Lib/CMake SCRIPT=travis_deploy.bash DEPLOY_NAME=All
os: osx
# No need to test dockerfiles on macOS
- env: DIR=Dockerfiles SCRIPT=all.bash
os: osx
# Package Setup
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install software-properties-common -y; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository universe -y; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa -y; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install dfu-util tree exuberant-ctags gcc-arm-embedded python3-pip python3-setuptools -y; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python; fi # Homebrew defaults to Python 3 now, but we have to upgrade
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tree ctags dfu-util binutils gnu-sed; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "gcc" ]]; then brew tap Caskroom/cask; fi
# This fails to download sometimes, just retry till it works
- while [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "gcc" ]] && [[ "$EnableHostOnlyBuild" != "true" ]] && ! type arm-none-eabi-gcc &> /dev/null; do brew install Caskroom/cask/gcc-arm-embedded; done
# System setup
install:
# Info about OS
- uname -a
# Compiler Version
- ${CC} --version
# Python Version
- python --version
- python3 --version
# CMake Version
- cmake --version
# Prepare pipenv
- sudo -H pip3 install --upgrade pip
- sudo -H pip3 install kll
# Run test script(s)
script:
- cd ${DIR} && PIPENV_ACTIVE=1 COMPILER=${CC} ./${SCRIPT}
# Setup Deploy
before_deploy:
- mkdir -p deploy
# Copy files for deployment and prepend the tag name
- if [[ "$SCRIPT" == "ic_keyboards.bash" ]]; then for f in Keyboards/firmware/*.dfu.bin; do cp -f ${f} deploy/${TRAVIS_TAG}.$(basename ${f}); done; fi
- if [[ "$SCRIPT" == "all.bash" ]]; then for f in Bootloader/Builds/bootloader/*.bootloader.bin; do cp -f ${f} deploy/${TRAVIS_TAG}.$(basename ${f}); done; fi
# Show files being deployed
- tree deploy
# Deploy release
deploy:
name: ${TRAVIS_TAG}
body: $(git for-each-ref --format '%(refname) %09 %(taggerdate) %(subject) %(taggeremail)' refs/tags/${TRAVIS_TAG})
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
draft: true # XXX Must "publish" on github
prerelease: true # XXX Set this to false to enable a stable release
file_glob: true
file: deploy/*.bin
on:
tags: true
repo: kiibohd/controller
condition: $TRAVIS_OS_NAME = linux
condition: $DEPLOY_NAME != ""