Project that contains: platformio setup, arduino framework, unit test, integration tests and pipeline for CI & CD (Github Actions)
In order to run integration tests, you will need to login to your platformio account:
$ platformio account login
Connect your arduino board via USB and start the remote agent
$ platformio remote agent start
If everything is ok, you should get the following info on your terminal:
2020-12-13 23:07:38 [info] Connecting to PlatformIO Remote Development Cloud
2020-12-13 23:07:39 [info] Successfully connected
2020-12-13 23:07:39 [info] Authenticating
2020-12-13 23:07:40 [info] Successfully authorized
Generate an platformio account token:
$ platformio account token
You should see on your terminal the token generated, then as the final step to allow the pipeline (github actions) to connect with your arduino board you should save the token as a secret on your github repository: On your repository > Settings > Secrets > New repository secret: Use next environment variable: PLATFORMIOAGENT
You can run your unit or integration tests using Platformio IDE or Platformio CLI (terminal)
- Platformio IDE: Platformio option > env:native > Advanced > Test
- Platformio CLI:
$ platformio test --environment native -f unit -v
Be sure that you have connected your Arduino board before run integration tests:
- Platformio IDE: Platformio option > env:uno > Advanced > Test
- Platformio CLI:
$ platformio test --environment uno -f integration -v
The jobs that the pipeline will be executing after you do a push on your repository are on: .github/workflows/main.yml
and those are:
- build-and-tests (unit and integration tests)
- deploy-firmware
Make sure that you have configured the secret variable and running the platformio agent before executing the pipeline.
- atmelavr (uno tested)
- native
- ArduinoFake