Skip to content

Commit ca93798

Browse files
committed
Remove travis and update build script
1 parent 8a97212 commit ca93798

7 files changed

+79
-85
lines changed

.auto-build.sh

+71-25
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,105 @@
1-
#/bin/bash
1+
#!/bin/bash
2+
#
3+
# MIT License
4+
#
5+
# Copyright (c) 2020-2022 Erriez
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in all
15+
# copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
# SOFTWARE.
24+
#
25+
26+
# Automatic build script
27+
#
28+
# To run locally, execute:
29+
# sudo apt install doxygen graphviz texlive-latex-base texlive-latex-recommended texlive-pictures texlive-latex-extra
230

331
# Exit immediately if a command exits with a non-zero status.
432
set -e
533

34+
DOXYGEN_PDF="ErriezMHZ19B.pdf"
35+
36+
637
echo "Starting auto-build script..."
738

39+
function setup_virtualenv()
40+
{
41+
if [ ! -d ".venv" ]; then
42+
virtualenv .venv
43+
source .venv/bin/activate
44+
pip3 install platformio==6.1.4
45+
deactivate
46+
fi
47+
48+
source .venv/bin/activate
49+
}
850

951
function autobuild()
1052
{
1153
# Set environment variables
1254
BOARDS_AVR="--board uno --board micro --board pro16MHzatmega328 --board pro8MHzatmega328 --board megaatmega2560 --board leonardo"
1355
BOARDS_ARM="--board due"
14-
BOARDS_ESP8266="--board d1_mini --board nodemcuv2"
56+
BOARDS_ESP8266="--board nodemcuv2"
1557
BOARDS_ESP32="--board lolin_d32"
1658

1759
echo "Installing library dependencies"
18-
platformio lib --global install https://github.com/Erriez/ErriezTM1637
19-
platformio lib --global install https://github.com/Erriez/ErriezRobotDyn4DigitDisplay
20-
platformio lib --global install https://github.com/knolleary/pubsubclient
60+
pio pkg install --global --library https://github.com/Erriez/ErriezTM1637
61+
pio pkg install --global --library https://github.com/Erriez/ErriezRobotDyn4DigitDisplay
62+
pio pkg install --global --library https://github.com/knolleary/pubsubclient
2163

2264
echo "Install ESPSoftwareSerial into framework-arduinoespressif32 to prevent conflicts with generic name SoftwareSerial"
2365
mkdir -p ~/.platformio/packages/framework-arduinoespressif32/libraries
24-
platformio lib --storage-dir ~/.platformio/packages/framework-arduinoespressif32/libraries install "ESPSoftwareSerial"
66+
platformio lib --storage-dir ~/.platformio/packages/framework-arduinoespressif32/libraries install "EspSoftwareSerial@6.16.1"
67+
# Cannot upgrade to pio pkg install command: https://github.com/platformio/platformio-core/issues/4410
68+
#pio pkg install --storage-dir ~/.platformio/packages/framework-arduinoespressif32/libraries --library "EspSoftwareSerial@6.16.1"
69+
70+
echo "Building examples..."
2571

26-
echo "Build examples"
27-
platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19B7SegmentDisplay/ErriezMHZ19B7SegmentDisplay.ino
28-
platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19BGettingStarted/ErriezMHZ19BGettingStarted.ino
29-
platformio ci --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19BSerialPlottter/ErriezMHZ19BSerialPlottter.ino
30-
platformio ci --lib="." ${BOARDS_ESP8266} examples/ErriezMHZ19BESP8266MQTT/ErriezMHZ19BESP8266MQTT.ino
72+
# Use option -O "lib_ldf_mode=chain+" to parse defines
73+
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19B7SegmentDisplay/ErriezMHZ19B7SegmentDisplay.ino
74+
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19BGettingStarted/ErriezMHZ19BGettingStarted.ino
75+
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_AVR} ${BOARDS_ARM} ${BOARDS_ESP8266} ${BOARDS_ESP32} examples/ErriezMHZ19BSerialPlottter/ErriezMHZ19BSerialPlottter.ino
76+
pio ci -O "lib_ldf_mode=chain+" --lib="." ${BOARDS_ESP8266} examples/ErriezMHZ19BESP8266MQTT/ErriezMHZ19BESP8266MQTT.ino
3177
}
3278

3379
function generate_doxygen()
3480
{
35-
echo "Generate Doxygen HTML..."
36-
37-
DOXYGEN_PDF="ErriezMHZ19B.pdf"
81+
if [ ! -f Doxyfile ]; then
82+
return
83+
fi
3884

39-
# Cleanup
40-
rm -rf html latex
85+
echo "Generate Doxygen HTML..."
4186

4287
# Generate Doxygen HTML and Latex
4388
doxygen Doxyfile
4489

45-
# Allow filenames starting with an underscore
46-
echo "" > html/.nojekyll
90+
# Allow filenames starting with an underscore
91+
echo "" > docs/html/.nojekyll
4792

48-
# Generate PDF when script is not running on Travis-CI
49-
if [[ -z ${TRAVIS_BUILD_DIR} ]]; then
50-
# Generate Doxygen PDF
51-
make -C latex
93+
# Generate Doxygen PDF
94+
make -C docs/latex
5295

53-
# Copy PDF to root directory
54-
cp latex/refman.pdf ./${DOXYGEN_PDF}
55-
fi
96+
# Copy PDF to root directory
97+
cp docs/latex/refman.pdf ./${DOXYGEN_PDF}
98+
99+
# Cleanup
100+
#rm -rf docs
56101
}
57102

103+
setup_virtualenv
58104
autobuild
59105
generate_doxygen

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
# Ignore the following files when creating a release
66
/.gitattributes export-ignore
77
/.gitignore export-ignore
8-
/.travis.yml export-ignore
98
/.*.sh export-ignore

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
*.app
3333

3434
.idea/
35-
platformio/
35+
docs/

.travis.yml

-55
This file was deleted.

Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PROJECT_LOGO = extras/MHZ19B.png
5858
# entered, it will be relative to the location where doxygen was started. If
5959
# left blank the current directory will be used.
6060

61-
OUTPUT_DIRECTORY =
61+
OUTPUT_DIRECTORY = docs
6262

6363
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
6464
# directories (in 2 levels) under the output directory of each output format and

ErriezMHZ19B.pdf

-188 KB
Binary file not shown.

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# Erriez MH-Z19B CO2 sensor library for Arduino
1+
[![Licence MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/Erriez/ErriezMHZ19B/blob/master/LICENSE)
2+
[![Language C/C++](https://img.shields.io/badge/language-C%2FC%2B%2B-informational)](https://github.com/Erriez/ErriezMHZ19B)
3+
[![Release tag](https://img.shields.io/github/v/release/Erriez/ErriezMHZ19B?display_name=tag)](https://github.com/Erriez/ErriezMHZ19B/releases)
4+
[![Open issue](https://shields.io/github/issues-raw/Erriez/ErriezMHZ19B)](https://github.com/Erriez/ErriezMHZ19B/issues)
5+
[![PlatformIO CI](https://github.com/Erriez/ErriezMHZ19B/actions/workflows/actions.yml/badge.svg)](https://github.com/Erriez/ErriezMHZ19B/actions/workflows/actions.yml)
26

3-
[![Build Status](https://travis-ci.org/Erriez/ErriezMHZ19B.svg?branch=master)](https://travis-ci.org/Erriez/ErriezMHZ19B)
7+
# Erriez MH-Z19B CO2 sensor library for Arduino
48

59
This is a MH-Z19B CO2 sensor library for Arduino. It has been built from scratch to support hardware
610
and software serial with a small footprint.

0 commit comments

Comments
 (0)