Build and Run #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Run | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: '00 22 * * 0' | |
| # A new triggered workflow run will interrupt an existing workflow run | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-run: | |
| name: Build and Run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Activate vcpkg | |
| uses: ARM-software/cmsis-actions/vcpkg@v1 | |
| with: | |
| config: "./vcpkg-configuration.json" | |
| - name: Activate Arm tool license | |
| uses: ARM-software/cmsis-actions/armlm@v1 | |
| # Configure AWS IoT Thing Credentials | |
| - name: Configure AWS IoT Thing Credentials | |
| env: | |
| # Get the secrets from the Github | |
| IOT_THING_NAME: ${{ secrets.IOT_THING_NAME }} | |
| MQTT_BROKER_ENDPOINT: ${{ secrets.MQTT_BROKER_ENDPOINT }} | |
| ROOT_CA_PEM: ${{ secrets.ROOT_CA_PEM }} | |
| CLIENT_CERTIFICATE_PEM: ${{ secrets.CLIENT_CERTIFICATE_PEM }} | |
| CLIENT_PRIVATE_KEY_PEM: ${{ secrets.CLIENT_PRIVATE_KEY_PEM }} | |
| run: | | |
| node ./scripts/configure-aws-iot-thing.js \ | |
| ./FreeRTOS-Plus/Demo/Config/demo_config_template.h \ | |
| ./FreeRTOS-Plus/Demo/Config/demo_config.h | |
| # Build the executable | |
| - name: Build executable | |
| run: | | |
| cbuild Demo.csolution.yml --packs --context .Debug+Simulator --rebuild | |
| # Execute the demo | |
| - name: Execute AWS_MQTT demo | |
| run: | | |
| FVP_Corstone_SSE-300 \ | |
| -a ./out/Demo/Simulator/Debug/Demo.axf \ | |
| -f ./Board/AVH_MPS3_Corstone-300/fvp_config.txt \ | |
| --simlimit 120 --stat -Q 10 > ./out/Demo/AWS_MQTT_Demo.log | |
| cat ./out/Demo/AWS_MQTT_Demo.log | |
| # Analyze results | |
| - name: Analyze results | |
| run: | | |
| echo "Checking if a MQTT packet has been received" | |
| if [ "$(grep -c "Incoming Publish Message : Hello World!" ./out/Demo/AWS_MQTT_Demo.log)" -eq 0 ] | |
| then | |
| exit 1 | |
| else | |
| exit 0 | |
| fi |