1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Verify sketches as part of travis build

Squashed commits:
[7d1b42f] Encrypt token, skip some tests
[17b8f39] Fix sha1 example path
[f3050b1] Fix build, add webhook
[fd2c9bd] Fix build errors, update mDNS library readme
[7b87031] Make common.sh more flexible
[3ba3eb2] Test all sketches
[87beb8a] Build all sketches in esp8266 core
[f2464f1] Fix paths
[823a9ae] Remove sudo usage
[7fce734] Fix arduino commands
[619bc7d] Move all commands into travis script
[15a5ada] First attempt test runner
This commit is contained in:
Ivan Grokhotkov 2015-07-23 12:11:59 +03:00
parent d35b72d41c
commit 496da02f14
10 changed files with 115 additions and 91 deletions

View File

@ -1,35 +1,38 @@
sudo: true
sudo: false
language: java
os:
- linux
- osx
addons:
apt:
packages:
- ant
jdk:
- oraclejdk8
script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -qq ant; fi
- pushd build
- echo "" | ant dist
- echo "" | ant build
- popd
#- bash -x ./generate-appimage
deploy:
provider: releases
api_key:
secure: eKHcAMuC58JZKRsn1QwbiYE4aL/9dZsybDqqHTo1dUo8x9+3fGed/Dci76ItFFS7SmFfIdl6ej8/Uj0nPK/sIE21blKBe3+L0KAJm0TTq3m0ig1suCmMipCsSW+srWYM0hl58+OKagM4FoHKDjsEnzRDv9Z4xtxyvG+7/XLD1dE=
skip_cleanup: true
file_glob: true
file:
- '$TRAVIS_BUILD_DIR/build/linux/arduino-*.tar.xz'
# - '$TRAVIS_BUILD_DIR/Arduino.AppImage'
on:
tags: true
all_branches: true
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
- sleep 3
- export DISPLAY=:1.0
- export PATH="$PWD/build/linux/work:$PATH"
- which arduino
- source hardware/esp8266com/esp8266/tests/common.sh
- arduino --board esp8266com:esp8266:generic --save-prefs
- build_sketches arduino $PWD/hardware/esp8266com/esp8266
notifications:
email:
on_success: change
on_failure: change
webhooks:
urls:
- secure: "dnSY+KA7NK+KD+Z71copmANDUsyVePrZ0iXvXxmqMEQv+lp3j2Z87G5pHn7j0WNcNZrejJqOdbElJ9Q4QESRaAYxTR7cA6ameJeEKHiFJrQtN/4abvoXb9E1CxpL8aNON/xgnqCk+fycOK3nbWWXlJBodzBm7KN64vrcHO7et+M="
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

View File

@ -1,5 +1,4 @@
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
#include <ESP8266WebServer.h>
#include <ESP8266SSDP.h>

View File

@ -38,9 +38,8 @@
const char* ssid = "**********";
const char* password = "**********";
const char* hostname = "esp8266sd";
const char* host = "esp8266sd";
MDNSResponder mdns;
ESP8266WebServer server(80);
static bool hasSD = false;
@ -245,10 +244,11 @@ void setup(void){
DBG_OUTPUT_PORT.print("Connected! IP address: ");
DBG_OUTPUT_PORT.println(WiFi.localIP());
if (mdns.begin(hostname, WiFi.localIP())) {
if (MDNS.begin(host)) {
MDNS.addService("http", "tcp", 80);
DBG_OUTPUT_PORT.println("MDNS responder started");
DBG_OUTPUT_PORT.print("You can now connect to http://");
DBG_OUTPUT_PORT.print(hostname);
DBG_OUTPUT_PORT.print(host);
DBG_OUTPUT_PORT.println(".local");
}

View File

@ -19,12 +19,12 @@ Usage
-----
1. Download this repository as a zip (button on the right) and follow [these instructions to install into Arduino](http://arduino.cc/en/Guide/Libraries).
2. Include the ESP8266mDNS library in the sketch.
3. Create an instance of the MDNSResponder class.
4. Call the begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the
IP address to advertise. Optionally provide a time to live (in seconds)
for the DNS record--the default is 1 hour.
5. Call the update method in each iteration of the sketch's loop function.
3. Call MDNS.begin method in the sketch's setup and provide a domain name (without
the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'). Optionally provide
the IP address to advertise and time to live (in seconds) for the DNS record -- the default is 1 hour.
4. To advertise DNS-SD services, call MDNS.addService(service, proto, port), where service and proto
are strings with service and protocol name (e.g. "http", "tcp"), and port is an integer port number
for this service (e.g. 80).
See the included MDNS + HTTP server sketch for a full example.

View File

@ -1,6 +1,6 @@
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUDP.h>
#include <WiFiUdp.h>
const char* host = "esp8266-ota";
const char* ssid = "**********";

22
tests/common.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
function build_sketches()
{
local arduino=$1
local srcpath=$2
local sketches=$(find $srcpath -name *.ino)
for sketch in $sketches; do
local sketchdir=$(dirname $sketch)
if [[ -f "$sketchdir/.test.skip" ]]; then
echo -e "\n\n ------------ Skipping $sketch ------------ \n\n";
continue
fi
echo -e "\n\n ------------ Building $sketch ------------ \n\n";
$arduino --verify --verbose $sketch;
local result=$?
if [ $result -ne 0 ]; then
echo "Build failed ($1)"
return $result
fi
done
}