-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Arduino C# Compiler" #1785
"Arduino C# Compiler" #1785
Changes from all commits
411bdac
ece16ef
93f520b
c14668f
00245d7
c14ad7a
f8389f4
8639b3b
cfb5266
9f422e2
320a781
b426aa8
70b6726
b9a301b
320cf63
d23e8ae
d93ced9
9430ec0
d0a5a9b
b367114
5342cf6
6f0318d
8c95c09
2df6118
390cee8
df2358b
3b2cb8d
04de3c1
0863ecd
7141bc5
7c1599a
21a92f6
719945b
ff726aa
152a38f
9fa5f01
bb2c0f9
1437290
1521838
441bed9
d5a2f3c
a337431
fd8a5a7
c74fdf5
db57f45
e84c42f
d1c8316
9f9fbd6
0e1499f
c71cded
109ec9c
c459983
43ad122
5833e50
332fc0c
138f337
f94da1e
c4b05af
a27dce1
bb1e538
046c3e0
3838f8d
e3b3812
606c5cb
059aae5
47ba4e8
a9b8a75
bc24078
6a6ee60
46ee69a
225d2e4
132d555
ff17f55
cd55b87
73174cf
a783199
38ae7ba
fa305f8
ffa18e8
79a0bcb
734b79a
2c8f054
19eaa27
c4aa791
243c118
937bb0f
c3c0a92
ee142ed
491446b
ec0f141
2a5770c
ff40beb
259e344
f57fad3
3fab03d
33abd06
01ed14d
7c383ed
4ab9c7b
b99dc25
d10a9d5
15b4d93
b818858
867c1d4
e45d410
cf91cd7
b19cebb
bb7d052
3f6c8b0
6a8449a
f95311b
0968213
59260e4
4e64277
c81d9a1
30c7488
cb5e3e4
447d836
55429b5
8cdefad
7c4fb5c
ec1395b
8616f3c
f46c54b
c8095a9
859e28d
05b4fad
a521dcb
0f16051
7f495a7
49ee317
bf08345
9a4d830
e3308b0
7fc74a2
6895f51
fd7a1b8
96c3713
210607f
c96db32
3087d29
71a3c7b
e764056
7b47781
9738853
1e0e5c9
9a49d95
0c6ccab
2f3a12b
948cb7c
470c7ef
b6321d0
36b0aca
d71a665
b053694
961b637
dbdc7f8
277255a
ea0f25b
3d4a7f7
4a6c3cb
a33213e
95088d8
59e54e3
bfff285
e031347
5690a0b
b189e32
72d11c5
6638b17
8cfc039
eeabbf6
ad16fd3
1925b72
d4ffba2
4b2784b
1dc6aa2
f17a0c2
ff3b7fb
7196d76
42a11ac
e70484e
c942830
c84a8a3
83779f3
abd97d3
043ff8b
d6b7e42
416e46d
f24c700
d340293
1abfca3
8869ea3
dd32e2d
59a2be0
f9b6f77
af481ed
71a2ab2
cefd829
542bfeb
091932f
fed769b
e10647a
16f77d9
391bf1e
2c6afa1
12a0225
978db81
e4588cd
341150e
6475720
cd009ba
6c3c4e5
bb119a2
fd1be2b
4ce450e
da04ddb
09b1484
e32171e
4157bd6
951c25b
c43e0aa
891d87a
450beec
5fb3d77
d9be545
bb29286
24f2940
fa38450
2e70de4
2650032
c8f4a6e
14dc48a
fcfec26
5cdea17
806343e
0a70ea9
04aa285
8a89b1e
7500dce
b793cf9
3b7b845
1c6a6bb
9c5359c
08fd86b
853259a
d1e2711
7c238ef
15ce5b1
d5a4a5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
echo on | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per my previous comment, let's just remove this file for now. We can later decide to add a separate pipeline that we can conditionally invoke in some PRs that where it is relevant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the build script, not the yml file. We might adapt or change this, but deleting won't help. |
||
|
||
REM First argument is the path to the user home directory (typically C:\Users\VssAdministrator) | ||
REM Second argument is either "Debug" or "Release" | ||
if %1!==! goto :usage | ||
|
||
REM Defines the revision to check out in the ExtendedConfigurableFirmata repo | ||
set FIRMATA_SIMULATOR_CHECKOUT_REVISION=122ed75de8cb53e0dbd96cde71a7c9e21fe4be89 | ||
set RUN_COMPILER_TESTS=FALSE | ||
|
||
choco install -y --no-progress arduino-cli | ||
arduino-cli lib install "DHT sensor library" | ||
arduino-cli lib install "Servo" | ||
|
||
arduino-cli config init | ||
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json | ||
arduino-cli core update-index | ||
|
||
set ArduinoRootDir=%1\Documents\Arduino | ||
set acspath=%~dp0\..\tools\ArduinoCsCompiler\Frontend\bin\%2\net6.0\acs.exe | ||
|
||
git clone https://github.com/firmata/ConfigurableFirmata %ArduinoRootDir%\libraries\ConfigurableFirmata | ||
git clone https://github.com/pgrawehr/ExtendedConfigurableFirmata %ArduinoRootDir%\ExtendedConfigurableFirmata | ||
arduino-cli core install esp32:esp32 | ||
|
||
REM Check whether any compiler files have changed - if so, enable the (long running) compiler tests | ||
git diff --name-status origin/main | find /C /I "tools/ArduinoCsCompiler" | ||
REM Find returns 1 when the string was NOT found, we want to set the variable to true when it does find something | ||
if %errorlevel%==0 set RUN_COMPILER_TESTS=TRUE | ||
|
||
dir %ArduinoRootDir% | ||
|
||
%acspath% --help | ||
|
||
rem Write runtime data to ExtendedConfigurableFirmata directory, before building | ||
%acspath% prepare | ||
|
||
rem bring msbuild into the path | ||
call "c:\program files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" | ||
|
||
pushd %ArduinoRootDir%\ExtendedConfigurableFirmata | ||
|
||
REM checkout to the currently fixed branch | ||
git checkout -B main %FIRMATA_SIMULATOR_CHECKOUT_REVISION% | ||
|
||
dir | ||
REM First build the code for the ESP32 (this just verifies that the code builds, it does no run-time checks at all) | ||
arduino-cli compile --fqbn esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none ./ExtendedConfigurableFirmata.ino --warnings default | ||
if errorlevel 1 goto error | ||
|
||
REM then build the simulator code as Visual Studio C++ project | ||
msbuild /p:Configuration=%2 ExtendedConfigurableFirmataSim\ExtendedConfigurableFirmataSim.vcxproj | ||
if errorlevel 1 goto error | ||
|
||
REM Start the simulator asynchronously | ||
start ExtendedConfigurableFirmataSim\%2\ExtendedConfigurableFirmataSim.exe | ||
|
||
popd | ||
pushd %~dp0\..\tools\ArduinoCsCompiler\ | ||
|
||
REM This somehow gets disabled | ||
echo on | ||
REM and finally run the Arduino tests, now including the ones skipped previously. Set verbosity to normal to see | ||
REM information about all tests being executed (as this test run can take 30 mins or more) | ||
echo Starting basic arduino tests | ||
dotnet test -c %2 --no-build --no-restore --filter feature=firmata -l "console;verbosity=normal" -maxcpucount:1 | ||
|
||
echo on | ||
if %RUN_COMPILER_TESTS%==TRUE ( | ||
echo Starting extended Arduino compiler tests | ||
dotnet test -c %2 --no-build --no-restore --filter feature=firmata-compiler -l "console;verbosity=normal" -maxcpucount:1 | ||
) | ||
|
||
if errorlevel 1 goto error | ||
|
||
popd | ||
taskkill /im ExtendedConfigurableFirmataSim.exe /f | ||
|
||
Echo All done! | ||
exit /b 0 | ||
|
||
:error | ||
echo Tests failed. Error code %errorlevel% | ||
exit /b 1 | ||
:usage | ||
|
||
echo Usage: ArduinoCsCI.cmd [path-to-home-directory] [Configuration] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not add this to the main build yet. We should either make a new pipeline for this that can be invoked manually for a PR (probably ideal) or have some sort of logic that detects for changes on the Arduino or compiler bindings and would only run this job if any changes are detected. This latter option is less ideal, mainly cause you can't really invoke it if you want to run it even when changes are not detected, and it is also less maintainable since could be prone to breaking if files get moved around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't see much of a problem the way it is now. This is easily identifyable as it is a separate build, and when it breaks on a PR it can quickly be checked whether the breakage is due to a bad change in the Arduino binding or whether it is due to some problem completely unrelated to the PR. This is much like we do with the hardware tests now. The number of PRs we have is not so big that this extra check cost really a lot of time right now.