forked from aws/aws-iot-device-sdk-embedded-C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (37 loc) · 1.8 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
language: c
install:
# Remove placeholders.
- rm external_libs/CppUTest/*
- rm external_libs/mbedTLS/*
# Get mbedtls.
- wget -qO- https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.18.1.tar.gz | tar xvz -C external_libs/mbedTLS --strip-components=1
- wget -qO- https://github.com/ARMmbed/mbed-crypto/archive/mbedcrypto-1.1.1.tar.gz | tar xvz -C external_libs/mbedTLS/crypto --strip-components=1
# Get CppUTest.
- wget -qO- https://github.com/cpputest/cpputest/archive/v3.6.tar.gz | tar xvz -C external_libs/CppUTest --strip-components=1
script:
# Verify that the samples build.
- cd samples/linux/jobs_sample
- make -j2
- cd ../shadow_sample
- make -j2
- cd ../shadow_sample_console_echo
- make -j2
- cd ../subscribe_publish_library_sample
- make -j2
- cd ../subscribe_publish_sample
- make -j2
# Build and run unit tests.
- cd ../../../
- make build-cpputest -j2
- make all_no_tests -j2
- ./IotSdkC_tests -v
# Set up integration tests if not a pull request.
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cd tests/integration; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sed -i 's/^.*#define AWS_IOT_MQTT_HOST.*$/#define AWS_IOT_MQTT_HOST "'"$AWS_IOT_ENDPOINT"'"/' include/aws_iot_config.h; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make app -j2; fi
# Import credentials for integration tests.
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O ../../certs/rootCA.crt; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo -e $AWS_IOT_CLIENT_CERT > ../../certs/cert.pem; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo -e $AWS_IOT_PRIVATE_KEY > ../../certs/privkey.pem; fi
# Run integration tests.
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then ./integration_tests_mbedtls; fi