wifi-tally_Oostendam/wifi-tally/.travis.yml
Eljakim Herrewijnen 50b5fc1824 Initial commit
2021-09-27 21:52:27 +02:00

170 lines
5.6 KiB
YAML

os: linux
dist: bionic
language: python
addons:
apt:
packages:
# for building the firmware
- srecord
# easy listing of what will be added to the release
- tree
env:
# nodemcu uses an old lua version
- LUA="5.1.4"
NODEMCU_FIRMWARE="3.0-master_20200610"
NODEMCU_MODULES="encoder,file,gpio,net,node,pwm2,struct,tmr,uart,wifi,ws2812"
NODEJS_VERSION="12"
NODEJS_MODULE_VERSION="72"
before_install:
# lua toolchain for running tests
- pip install hererocks
- hererocks lua_install -rlatest -l${LUA}
- export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH
# nodemcu toolchain to cross compile
- git clone --depth 1 --recurse-submodules --branch "${NODEMCU_FIRMWARE}" https://github.com/nodemcu/nodemcu-firmware.git $TRAVIS_BUILD_DIR/nodemcu-firmware
- make -C $TRAVIS_BUILD_DIR/nodemcu-firmware/app/lua/luac_cross/
- export PATH=$PATH:$TRAVIS_BUILD_DIR/nodemcu-firmware
# nodemcu-custom-build to easily build the firmware
- git clone --depth 1 --branch master https://github.com/marcelstoer/nodemcu-custom-build.git $TRAVIS_BUILD_DIR/nodemcu-custom-build
# @see https://github.com/marcelstoer/nodemcu-custom-build/blob/master/.travis.yml for used environment variables
- export USER_PROLOG=""
- export X_EMAIL="invalid@example.com"
- export X_BRANCH=$NODEMCU_FIRMWARE
- export X_MODULES=$NODEMCU_MODULES
- export X_U8G_FONTS="font_6x10,font_chikita"
- export X_U8G_DISPLAY_I2C=""
- export X_U8G_DISPLAY_SPI=""
- export X_UCG_DISPLAY_SPI=""
- export X_LUA_FLASH_STORE="0x15000"
- export X_SPIFFS_FIXED_LOCATION="0"
- export X_SPIFFS_MAX_FILESYSTEM_SIZE="0"
- export X_SSL_ENABLED="false"
- export X_DEBUG_ENABLED="false"
- export X_FATFS_ENABLED="false"
- export X_NUMBER_OF_MODULES=$(echo $X_MODULES | awk -F\, '{print NF}')
# needed to build esptool.py
- pip install pyserial
# before-script.sh expects the folder at that location
- ln -s $TRAVIS_BUILD_DIR/nodemcu-custom-build/ESP8266 $TRAVIS_BUILD_DIR
# tools for building docs
- pip install mkdocs mkdocs-material pygments mkdocs-macros-plugin
- pip list
- export BUILD_NAME=$(git describe --tags --always)
install:
- luarocks install busted
- cd $TRAVIS_BUILD_DIR/nodemcu-firmware
- bash "${TRAVIS_BUILD_DIR}/nodemcu-custom-build/ESP8266/install.sh"
before_script:
- cd $TRAVIS_BUILD_DIR/nodemcu-firmware
- bash "${TRAVIS_BUILD_DIR}/nodemcu-custom-build/ESP8266/before-script.sh"
# building the firmware
- cd $TRAVIS_BUILD_DIR/nodemcu-firmware
- bash "${TRAVIS_BUILD_DIR}/firmware/script.sh"
script:
# building and testing the tally
- cd $TRAVIS_BUILD_DIR/tally
- make test
- make build
# rendering documentation
- cd $TRAVIS_BUILD_DIR/documentation
- mkdocs build
# building and testing the hub
- cd $TRAVIS_BUILD_DIR/hub
- nvm use "${NODEJS_VERSION}"
- node -v
- npm -v
- npm ci
- npm run test:ci
- npm run build
# bundling the release
- mkdir -p $TRAVIS_BUILD_DIR/release
- cp $TRAVIS_BUILD_DIR/Readme.md $TRAVIS_BUILD_DIR/release
- cp $TRAVIS_BUILD_DIR/LICENSE $TRAVIS_BUILD_DIR/release
- echo "${BUILD_NAME}" > $TRAVIS_BUILD_DIR/release/VERSION.txt
- mkdir $TRAVIS_BUILD_DIR/release/firmware
- cp $TRAVIS_BUILD_DIR/nodemcu-firmware/bin/nodemcu-*.bin $TRAVIS_BUILD_DIR/release/firmware
- cp -r $TRAVIS_BUILD_DIR/tally/out $TRAVIS_BUILD_DIR/release/tally
- cp $TRAVIS_BUILD_DIR/tally/tally-settings.ini.example $TRAVIS_BUILD_DIR/release/tally
- cp $TRAVIS_BUILD_DIR/tally/src/init.lua $TRAVIS_BUILD_DIR/release/tally
- mkdir -p $TRAVIS_BUILD_DIR/release/docs
- cp -r $TRAVIS_BUILD_DIR/documentation/docs $TRAVIS_BUILD_DIR/release/docs/markdown
- cp -r $TRAVIS_BUILD_DIR/documentation/site $TRAVIS_BUILD_DIR/release/docs/html
- cp -r $TRAVIS_BUILD_DIR/hub $TRAVIS_BUILD_DIR/release/hub
- find $TRAVIS_BUILD_DIR/release -name ".gitignore" -delete
- cd $TRAVIS_BUILD_DIR/release
# log the files added to release
- tree -I "node_modules"
- du -h -d1
- mkdir "$TRAVIS_BUILD_DIR/artifacts"
- zip -Jrq "$TRAVIS_BUILD_DIR/artifacts/wifi-tally-${BUILD_NAME}.zip" *
- tar -czf "$TRAVIS_BUILD_DIR/artifacts/wifi-tally-${BUILD_NAME}.tar.gz" *
- tar -cjf "$TRAVIS_BUILD_DIR/artifacts/wifi-tally-${BUILD_NAME}.tar.xz" *
- >
echo "" &&
echo "--------------------------------------------------------------------" &&
echo "" &&
echo "If your build is successful the build artifacts will be available at" &&
echo "" &&
echo " * ${AWS_S3_NIGHTLY_BASEURI}/wifi-tally-${BUILD_NAME}.zip" &&
echo " * ${AWS_S3_NIGHTLY_BASEURI}/wifi-tally-${BUILD_NAME}.tar.gz" &&
echo " * ${AWS_S3_NIGHTLY_BASEURI}/wifi-tally-${BUILD_NAME}.tar.xz" &&
echo "" &&
echo "--------------------------------------------------------------------" &&
echo ""
deploy:
- provider: pages
edge: true
cleanup: false
local_dir: $TRAVIS_BUILD_DIR/documentation/site/
repo: wifi-tally/wifi-tally.github.io
target_branch: master
keep_history: false
token: $GITHUB_TOKEN
on:
branch: master
- provider: releases
edge: true
token: $GITHUB_TOKEN
file_glob: true
file: "$TRAVIS_BUILD_DIR/artifacts/*"
cleanup: false
draft: true
on:
tags: true
- provider: s3
access_key_id: ${AWS_S3_NIGHTLY_ID}
secret_access_key: ${AWS_S3_NIGHTLY_KEY}
bucket: ${AWS_S3_NIGHTLY_BUCKET}
region: ${AWS_S3_NIGHTLY_REGION}
local_dir: "$TRAVIS_BUILD_DIR/artifacts"
skip_cleanup: true
acl: public_read
on:
all_branches: true
notifications:
email:
on_success: change
on_failure: always