mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	Add Travis CI + Platform.io
This commit is contained in:
		
							
								
								
									
										44
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | ||||
| language: python | ||||
| python: | ||||
|     - "2.7" | ||||
|  | ||||
| # Cache PlatformIO packages using Travis CI container-based infrastructure | ||||
| #sudo: false | ||||
| cache: | ||||
|     directories: | ||||
|         - "~/.platformio" | ||||
|  | ||||
| env: | ||||
|     - PLATFORMIO_CI_SRC=examples/BlynkClient PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=examples/FileDownload PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=examples/MqttClient PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=examples/WebClient PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=tools/SimpleTest PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=tools/FactoryReset PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|     - PLATFORMIO_CI_SRC=tools/AT_Debug PLATFORMIO_CI_ARGS="--board=leonardo" | ||||
|  | ||||
|     # Arduino test | ||||
|     - PLATFORMIO_CI_SRC=extras/test_build PLATFORMIO_CI_ARGS="--project-option='framework=arduino' --board=uno --board=leonardo --board=yun --board=megaatmega2560 --board=genuino101 --board=mkr1000USB --board=zero --board=teensy31 --board=bluepill_f103c8 --board=uno_pic32 --board=esp01 --board=nodemcuv2 --board=esp32dev" | ||||
|  | ||||
|     # Energia test | ||||
|     - PLATFORMIO_CI_SRC=extras/test_build PLATFORMIO_CI_ARGS="--project-option='framework=energia' --board=lplm4f120h5qr" | ||||
|  | ||||
| install: | ||||
|     # ChipKIT issue: install 32-bit support for GCC PIC32 | ||||
|     - sudo apt-get install libc6-i386 | ||||
|  | ||||
|     - pip install -U https://github.com/platformio/platformio/archive/develop.zip | ||||
|  | ||||
|     # | ||||
|     # Libraries from PlatformIO Library Registry: | ||||
|     # | ||||
|     # http://platformio.org/lib/show/415/Blynk | ||||
|     # http://platformio.org/lib/show/419/SimpleTimer | ||||
|     # http://platformio.org/lib/show/89/PubSubClient | ||||
|     # http://platformio.org/lib/show/44/Time | ||||
|     # http://platformio.org/lib/show/1286/StreamDebugger | ||||
|  | ||||
|     - platformio lib -g install 415 419 89 44 1286 | ||||
|  | ||||
| script: | ||||
|     - platformio ci --lib="." $PLATFORMIO_CI_ARGS | ||||
							
								
								
									
										53
									
								
								extras/test_build/test_build.ino
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								extras/test_build/test_build.ino
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | ||||
| /************************************************************** | ||||
|  * | ||||
|  *  DO NOT USE THIS - this is just a compilation test! | ||||
|  * | ||||
|  **************************************************************/ | ||||
|  | ||||
| #include <TinyGsmClient.h> | ||||
|  | ||||
| TinyGsmClient client(Serial); | ||||
|  | ||||
| char server[] = "somewhere"; | ||||
| char resource[] = "something"; | ||||
|  | ||||
| void setup() { | ||||
|   Serial.begin(115200); | ||||
|   delay(3000); | ||||
|   client.restart(); | ||||
| } | ||||
|  | ||||
| void loop() { | ||||
|   if (!client.networkConnect("YourAPN", "", "")) { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   if (!client.connect(server, 80)) { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   // Make a HTTP GET request: | ||||
|   client.print(String("GET ") + resource + " HTTP/1.0\r\n"); | ||||
|   client.print(String("Host: ") + server + "\r\n"); | ||||
|   client.print("Connection: close\r\n\r\n"); | ||||
|  | ||||
|   unsigned long timeout = millis(); | ||||
|   while (client.connected() && millis() - timeout < 10000L) { | ||||
|     // Print available data | ||||
|     while (client.available()) { | ||||
|       char c = client.read(); | ||||
|       timeout = millis(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   client.stop(); | ||||
|  | ||||
|   client.networkDisconnect(); | ||||
|  | ||||
|   // Do nothing forevermore | ||||
|   while (true) { | ||||
|     delay(1000); | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user