mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	CI: Test ArduinoJson's configuration
This commit is contained in:
		
							
								
								
									
										46
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										46
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -125,6 +125,42 @@ jobs: | |||||||
|         env: |         env: | ||||||
|           UBSAN_OPTIONS: print_stacktrace=1 |           UBSAN_OPTIONS: print_stacktrace=1 | ||||||
|  |  | ||||||
|  |   conf_test: | ||||||
|  |     name: Test configuration on Linux | ||||||
|  |     needs: [gcc, clang] | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     steps: | ||||||
|  |       - name: Install | ||||||
|  |         run: sudo apt-get install -y g++-multilib | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: GCC 32-bit | ||||||
|  |         run: g++ -std=c++11 -m32 -Isrc extras/conf_test/x86-linux.cpp | ||||||
|  |       - name: GCC 64-bit | ||||||
|  |         run: g++ -std=c++11 -m64 -Isrc extras/conf_test/x64.cpp | ||||||
|  |       - name: Clang 32-bit | ||||||
|  |         run: clang++ -std=c++11 -m32 -Isrc extras/conf_test/x86-linux.cpp | ||||||
|  |       - name: Clang 64-bit | ||||||
|  |         run: clang++ -std=c++11 -m64 -Isrc extras/conf_test/x64.cpp | ||||||
|  |  | ||||||
|  |   conf_test_windows: | ||||||
|  |     name: Test configuration on Windows | ||||||
|  |     runs-on: windows-2019 | ||||||
|  |     needs: [gcc, clang] | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: 32-bit | ||||||
|  |         run: | | ||||||
|  |           call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | ||||||
|  |           cl /Isrc extras/conf_test/x86-windows.cpp | ||||||
|  |         shell: cmd | ||||||
|  |       - name: 64-bit | ||||||
|  |         run: | | ||||||
|  |           call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||||||
|  |           cl /Isrc extras/conf_test/x64.cpp | ||||||
|  |         shell: cmd | ||||||
|  |  | ||||||
|   xcode: |   xcode: | ||||||
|     name: XCode |     name: XCode | ||||||
|     needs: clang |     needs: clang | ||||||
| @@ -203,29 +239,36 @@ jobs: | |||||||
|             libraries: |             libraries: | ||||||
|               - SD |               - SD | ||||||
|               - Ethernet |               - Ethernet | ||||||
|  |             conf_test: avr | ||||||
|           - platform: espressif8266 |           - platform: espressif8266 | ||||||
|             board: huzzah |             board: huzzah | ||||||
|  |             conf_test: esp8266 | ||||||
|           - platform: espressif32 |           - platform: espressif32 | ||||||
|             board: esp32dev |             board: esp32dev | ||||||
|             libraries: |             libraries: | ||||||
|               - Ethernet |               - Ethernet | ||||||
|  |             conf_test: esp8266 | ||||||
|           - platform: atmelsam |           - platform: atmelsam | ||||||
|             board: mkr1000USB |             board: mkr1000USB | ||||||
|             libraries: |             libraries: | ||||||
|               - SD |               - SD | ||||||
|               - Ethernet |               - Ethernet | ||||||
|  |             conf_test: esp8266 | ||||||
|           - platform: teensy |           - platform: teensy | ||||||
|             board: teensy31 |             board: teensy31 | ||||||
|  |             conf_test: esp8266 | ||||||
|           - platform: ststm32 |           - platform: ststm32 | ||||||
|             board: adafruit_feather_f405 |             board: adafruit_feather_f405 | ||||||
|             libraries: |             libraries: | ||||||
|               - SD |               - SD | ||||||
|               - Ethernet |               - Ethernet | ||||||
|  |             conf_test: esp8266 | ||||||
|           - platform: nordicnrf52 |           - platform: nordicnrf52 | ||||||
|             board: adafruit_feather_nrf52840 |             board: adafruit_feather_nrf52840 | ||||||
|             libraries: |             libraries: | ||||||
|               - SD |               - SD | ||||||
|               - Ethernet |               - Ethernet | ||||||
|  |             conf_test: esp8266 | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout |       - name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v2 | ||||||
| @@ -256,6 +299,9 @@ jobs: | |||||||
|       - name: Install libraries |       - name: Install libraries | ||||||
|         if: ${{ matrix.libraries }} |         if: ${{ matrix.libraries }} | ||||||
|         run: platformio lib install arduino-libraries/${{ join(matrix.libraries, ' arduino-libraries/') }} |         run: platformio lib install arduino-libraries/${{ join(matrix.libraries, ' arduino-libraries/') }} | ||||||
|  |       - name: Test configuration | ||||||
|  |         run: platformio ci "extras/conf_test/${{ matrix.conf_test }}.cpp" -l '.' -b ${{ matrix.board }} | ||||||
|  |         if: ${{ matrix.conf_test }} | ||||||
|       - name: Build JsonConfigFile |       - name: Build JsonConfigFile | ||||||
|         run: platformio ci "examples/JsonConfigFile/JsonConfigFile.ino" -l '.' -b ${{ matrix.board }} |         run: platformio ci "examples/JsonConfigFile/JsonConfigFile.ino" -l '.' -b ${{ matrix.board }} | ||||||
|       - name: Build JsonFilterExample |       - name: Build JsonFilterExample | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								extras/conf_test/avr.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								extras/conf_test/avr.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | #include <ArduinoJson.h> | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_LONG_LONG == 0, "ARDUINOJSON_USE_LONG_LONG"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 1, | ||||||
|  |               "ARDUINOJSON_SLOT_OFFSET_SIZE"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_DOUBLE == 0, "ARDUINOJSON_USE_DOUBLE"); | ||||||
|  |  | ||||||
|  | static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 8, | ||||||
|  |               "sizeof(VariantSlot)"); | ||||||
|  |  | ||||||
|  | void setup() {} | ||||||
|  | void loop() {} | ||||||
							
								
								
									
										16
									
								
								extras/conf_test/esp8266.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								extras/conf_test/esp8266.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | #include <ArduinoJson.h> | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_LONG_LONG == 0, "ARDUINOJSON_USE_LONG_LONG"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 2, | ||||||
|  |               "ARDUINOJSON_SLOT_OFFSET_SIZE"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_DOUBLE == 0, "ARDUINOJSON_USE_DOUBLE"); | ||||||
|  |  | ||||||
|  | static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 16, | ||||||
|  |               "sizeof(VariantSlot)"); | ||||||
|  |  | ||||||
|  | void setup() {} | ||||||
|  | void loop() {} | ||||||
							
								
								
									
										15
									
								
								extras/conf_test/x64.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								extras/conf_test/x64.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | #include <ArduinoJson.h> | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 4, | ||||||
|  |               "ARDUINOJSON_SLOT_OFFSET_SIZE"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); | ||||||
|  |  | ||||||
|  | static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 32, | ||||||
|  |               "sizeof(VariantSlot)"); | ||||||
|  |  | ||||||
|  | int main() {} | ||||||
							
								
								
									
										15
									
								
								extras/conf_test/x86-linux.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								extras/conf_test/x86-linux.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | #include <ArduinoJson.h> | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 4, | ||||||
|  |               "ARDUINOJSON_SLOT_OFFSET_SIZE"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); | ||||||
|  |  | ||||||
|  | static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 20, | ||||||
|  |               "sizeof(VariantSlot)"); | ||||||
|  |  | ||||||
|  | int main() {} | ||||||
							
								
								
									
										15
									
								
								extras/conf_test/x86-windows.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								extras/conf_test/x86-windows.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | #include <ArduinoJson.h> | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 4, | ||||||
|  |               "ARDUINOJSON_SLOT_OFFSET_SIZE"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); | ||||||
|  |  | ||||||
|  | static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); | ||||||
|  |  | ||||||
|  | static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 24, | ||||||
|  |               "sizeof(VariantSlot)"); | ||||||
|  |  | ||||||
|  | int main() {} | ||||||
		Reference in New Issue
	
	Block a user