Skip to content

Commit 5a6a6bb

Browse files
authored
Merge pull request #91 from govorox/v1.3.0
Release Branch v1.3.0
2 parents 9f4812b + f448137 commit 5a6a6bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1067
-357
lines changed

Diff for: .github/workflows/arduino_examples.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build Arduino Examples
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.8'
17+
18+
- name: Install pyserial
19+
run: python3 -m pip install pyserial
20+
21+
- name: Install Arduino CLI
22+
uses: arduino/setup-arduino-cli@v2
23+
24+
- name: Install Arduino Cores
25+
run: |
26+
arduino-cli config init
27+
arduino-cli core update-index
28+
arduino-cli core install arduino:avr
29+
30+
- name: Install specific branch of GovoroxSSLClient
31+
run: |
32+
mkdir -p ~/Arduino/libraries
33+
git clone --branch v1.3.0 https://github.com/govorox/SSLClient.git ~/Arduino/libraries/GovoroxSSLClient
34+
35+
- name: Install other libs
36+
run: |
37+
arduino-cli lib install "WiFi"
38+
arduino-cli lib install "ArduinoHttpClient"
39+
arduino-cli lib install "PubSubClient"
40+
arduino-cli lib install "TinyGSM"
41+
42+
- name: Compile Examples for [email protected]
43+
run: |
44+
arduino-cli core install esp32:[email protected]
45+
./.github/workflows/scripts/compile_arduino_examples.sh --clean
46+
47+
# - name: Compile Examples for [email protected]
48+
# run: |
49+
# arduino-cli core install esp32:[email protected]
50+
# ./.github/workflows/scripts/compile_arduino_examples.sh --clean

Diff for: .github/workflows/ci_master.yml

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Run PlatformIO Tests
1+
name: Run Unit Tests
22

33
on:
4-
pull_request:
4+
push:
55
branches:
66
- master
77
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
pull_request:
9+
branches:
10+
- master
11+
workflow_dispatch:
812

913
jobs:
1014
test:
@@ -23,5 +27,26 @@ jobs:
2327
run: |
2428
pip install platformio
2529
26-
- name: Run tests
30+
- name: Set Environment MBEDTLS_VERSION_MAJOR Variable
31+
run: echo "MBEDTLS_VERSION_MAJOR=3" >> $GITHUB_ENV
32+
33+
- name: Run tests - First Batch
34+
run: pio test -e native -vvv
35+
36+
- name: Clean up - First Batch
37+
run: pio run -t clean
38+
39+
- name: Set Environment MBEDTLS_BACKPORT Variable
40+
run: echo "MBEDTLS_BACKPORT=true" >> $GITHUB_ENV
41+
42+
- name: Run tests - Second Batch
43+
run: pio test -e native -vvv
44+
45+
- name: Clean up - Second Batch
46+
run: pio run -t clean
47+
48+
- name: Set Environment W5500_WORKAROUND Variable
49+
run: echo "W5500_WORKAROUND=true" >> $GITHUB_ENV
50+
51+
- name: Run tests - Third Batch
2752
run: pio test -e native -vvv

Diff for: .github/workflows/pio_examples.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build PlatformIO Examples
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.8'
17+
18+
- name: Install PlatformIO
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install platformio
22+
23+
- name: Compile Examples
24+
run: |
25+
./.github/workflows/scripts/compile_pio_examples.sh --clean
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/bash
2+
3+
ROOT_DIR=$(pwd)
4+
CLEAN=false
5+
BOARDS=("esp32:esp32:esp32doit-devkit-v1" "esp32:esp32:esp32wroverkit")
6+
7+
# Parse command line options
8+
while [[ "$#" -gt 0 ]]; do
9+
case $1 in
10+
--clean) CLEAN=true ;;
11+
*) echo "Unknown parameter passed: $1"; exit 1 ;;
12+
esac
13+
shift
14+
done
15+
16+
# Initialize results array
17+
declare -A RESULTS
18+
EXIT_STATUS=0
19+
20+
# Function to compile the example for a specific board
21+
compile_example() {
22+
local example_dir=$1
23+
local board=$2
24+
local example_name
25+
example_name=$(basename "$example_dir")
26+
echo "Compiling example in directory: $example_dir for board: $board"
27+
28+
cd "$example_dir" || exit 1
29+
30+
arduino-cli compile --clean --fqbn "$board" . || {
31+
echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log"
32+
RESULTS["$example_name,$board"]="Failed"
33+
EXIT_STATUS=1
34+
return 1
35+
}
36+
37+
echo "Compilation successful for $example_dir for board: $board"
38+
RESULTS["$example_name,$board"]="Passed"
39+
}
40+
41+
# Function to clean the example
42+
clean_example() {
43+
local example_dir=$1
44+
echo "Cleaning example in directory: $example_dir"
45+
46+
cd "$example_dir" || exit 1
47+
48+
arduino-cli cache clean || {
49+
echo "Cleaning failed for $example_dir"
50+
return 1
51+
}
52+
53+
echo "Cleaning successful for $example_dir"
54+
55+
# Remove build directory if --clean option is passed
56+
if [ "$CLEAN" = true ]; then
57+
echo "Removing build directory in $example_dir"
58+
rm -rf build
59+
fi
60+
61+
cd "$ROOT_DIR" || exit 1
62+
}
63+
64+
rm -f "$ROOT_DIR/compile_errors.log"
65+
66+
# compile_example "$ROOT_DIR"/examples/Esp32-Arduino-IDE/https_post_sim7600/ "esp32:esp32:esp32wroverkit"
67+
68+
# Iterate over each example directory
69+
for example_dir in "$ROOT_DIR"/examples/Esp32-Arduino-IDE/*/; do
70+
echo "$example_dir"
71+
# Check if the directory contains a .ino file
72+
if [ -f "$example_dir"/*.ino ]; then
73+
for board in "${BOARDS[@]}"; do
74+
compile_example "$example_dir" "$board"
75+
done
76+
77+
clean_example "$example_dir"
78+
else
79+
echo "Skipping directory $example_dir (no .ino file found)"
80+
fi
81+
done
82+
83+
# Generate summary
84+
echo "Compilation Summary:"
85+
echo "===================="
86+
for key in "${!RESULTS[@]}"; do
87+
IFS=',' read -r example_name board <<< "$key"
88+
echo "Example: $example_name, Board: $board, Result: ${RESULTS[$key]}"
89+
done
90+
91+
echo "All examples processed. Check compile_errors.log for any compilation errors."
92+
93+
exit $EXIT_STATUS

Diff for: .github/workflows/scripts/compile_pio_examples.sh

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/usr/bin/bash
2+
3+
# Set the root directory containing the example directories
4+
ROOT_DIR=$(pwd)
5+
CLEAN=false
6+
7+
# Boards to test
8+
BOARDS=("esp32dev" "esp32doit-devkit-v1" "esp-wrover-kit")
9+
10+
# Parse command line options
11+
while [[ "$#" -gt 0 ]]; do
12+
case $1 in
13+
--clean) CLEAN=true ;;
14+
*) echo "Unknown parameter passed: $1"; exit 1 ;;
15+
esac
16+
shift
17+
done
18+
19+
# Initialize results array
20+
declare -A RESULTS
21+
22+
# Function to compile the example for a specific board
23+
compile_example() {
24+
local example_dir=$1
25+
local board=$2
26+
local example_name
27+
example_name=$(basename "$example_dir")
28+
echo "Compiling example in directory: $example_dir for board: $board"
29+
30+
# Change to the example directory
31+
cd "$example_dir" || exit 1
32+
33+
# Check if the board environment is defined in platformio.ini
34+
if ! grep -q "\[env:$board\]" platformio.ini; then
35+
echo "Environment for board $board not defined in $example_dir/platformio.ini"
36+
RESULTS["$example_name,$board"]="Failed (environment not defined)"
37+
return 1
38+
fi
39+
40+
# Compile the example using platformio
41+
pio run -e "$board"
42+
43+
# Check if compilation was successful
44+
if [ $? -ne 0 ]; then
45+
echo "Compilation failed for $example_dir for board: $board" >> "$ROOT_DIR/compile_errors.log"
46+
RESULTS["$example_name,$board"]="Failed"
47+
return 1
48+
fi
49+
50+
echo "Compilation successful for $example_dir for board: $board"
51+
RESULTS["$example_name,$board"]="Passed"
52+
}
53+
54+
# Function to clean the example
55+
clean_example() {
56+
local example_dir=$1
57+
echo "Cleaning example in directory: $example_dir"
58+
59+
# Change to the example directory
60+
cd "$example_dir" || exit 1
61+
62+
# Clean the example using platformio
63+
if [ -f "platformio.ini" ]; then
64+
pio run --target clean
65+
else
66+
echo "No recognized build system (platformio.ini) found in $example_dir"
67+
return 1
68+
fi
69+
70+
echo "Cleaning successful for $example_dir"
71+
72+
# Remove .pio directory if --clean option is passed
73+
if [ "$CLEAN" = true ]; then
74+
echo "Removing .pio directory in $example_dir"
75+
rm -rf .pio
76+
fi
77+
78+
# Return to the root directory
79+
cd "$ROOT_DIR" || exit 1
80+
}
81+
82+
# Remove previous log file
83+
rm -f "$ROOT_DIR/compile_errors.log"
84+
85+
# Iterate over each example directory
86+
for example_dir in "$ROOT_DIR"/examples/Esp32-platformIO/*/; do
87+
echo "$example_dir"
88+
# Check if the directory contains platformio.ini
89+
if [ -f "$example_dir/platformio.ini" ]; then
90+
for board in "${BOARDS[@]}"; do
91+
compile_example "$example_dir" "$board"
92+
done
93+
94+
# Clean the example after all board-specific compilations are complete
95+
clean_example "$example_dir"
96+
else
97+
echo "Skipping directory $example_dir (no recognized build files)"
98+
fi
99+
done
100+
101+
# Generate summary
102+
echo "Compilation Summary:"
103+
echo "===================="
104+
for key in "${!RESULTS[@]}"; do
105+
IFS=',' read -r example_name board <<< "$key"
106+
echo "Example: $example_name, Board: $board, Result: ${RESULTS[$key]}"
107+
done
108+
109+
echo "All examples processed. Check compile_errors.log for any compilation errors."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/bash
2+
3+
rm -rf ~/SSLClient
4+
git clone https://github.com/govorox/SSLClient.git ~/SSLClient
5+
cd ~/SSLClient
6+
git checkout v1.3.0
7+
mkdir -p SSLClient
8+
mv LICENSE library.properties src SSLClient/
9+
zip -r SSLClient.zip SSLClient
10+
mkdir -p ~/.arduino15
11+
echo -e "library:\n enable_unsafe_install: true" > ~/.arduino15/arduino-cli.yaml
12+
arduino-cli lib install --config-file ~/.arduino15/arduino-cli.yaml --zip-path SSLClient.zip

0 commit comments

Comments
 (0)