PLT Hardware CI

PLT Hardware CI allows for Continuous Integration (CI) testing, automating the testing of firmware on target hardware, using the PLT.

Supported Environments

The PLT Hardware CI can be integrated with GitHub through the use of PLTcloud Action and PLT Hardware CI.

Setup

Prequisites

  • A GitHub account

  • A GitHub repository containing DUT firmware images and test plans

  • A PLTcloud organization, user and project

  • An enrolled PLT associated with a deployment group that will be used for CI testing

Step 1: Validate firmware build and test plans

In order to upload a release, the PLT test plan, and any associated assets such as DUT firmware must be available in a directory.

Your existing GitHub Action workflow should build the firmware and copy test plans to a known directory.

For example, the workflow in the Zephyr firmware for demo board project uses the /.github/actions/action-zephyr action to build the firmware files and copy the test plans to a dist/ directory.

Step 2: Configure project and token secrets

  • Log in to PLTcloud and select the Project menu item from the project drop-down in the top banner.

  • Copy the UUID from the project detail page and add a secret named PROJECT_UUID in your GitHub project.

  • Select API Tokens from the drop-down menu under the user menu in PLTcloud

  • Select Add Release Token, login and copy the Release Upload Token

  • Add the release token to GitHub secrets and name it API_TOKEN

  • Select the PLTs and select the deployment group you want to use.

  • Copy the UUID from the deployment group detail page and add a secret named DEPLOYMENT_GROUP_UUID in your GitHub project.

External References

Step 3: Add PLT Hardware CI to repository

In order to create a GitHub check run, add the PLT Hardware CI application. This mechanism allows result from PLT test plan execution to be reported in GitHub.

  • Select the organization where you want to install the PLT Hardware CI application.

  • Choose Only Select Repositories and select the repositories you want.

  • Select Save

Step 4: Add PLTcloud deployment to existing action

  • Add a step in the .github/workflows/main.yml workflow file, after the steps that build your firmware.

    - name: PLTcloud release
      uses: bcdevices/pltcloud-action@v1.1.0
      env:
        FILES: ./dist/*
        API_TOKEN: ${{ secrets.API_TOKEN }}
        PROJECT_UUID: ${{ secrets.PROJECT_UUID }}
        DEPLOYMENT_GROUP_UUID: ${{ secrets.DEPLOYMENT_GROUP_UUID }}'
        AUTO_DEPLOY: true
        VERSION: ${{ github.ref }}
    

Step 5: Add Report Connector to PLTcloud Project

The Report Connector is used to update the status of the GitHub check run after your test plan has been executed.

  • Log in to PLTcloud and select the Project menu item from the project drop-down in the top banner.

  • Choose Report Connector and Add Destination to add a new report connector.

  • Enter pltcloud-ci-reports-production for S3 Bucket.

  • Enter us-west-2 for Region.

  • Select json and Add.