diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7eaaf21..2ddd151 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,14 @@ -name: "Arduino" +name: Arduino -on: - push: - branches: [ "main" ] - jobs: +# Here we tell GitHub to run the workflow when a commit +# is pushed or a Pull Request is opened. +on: [push, pull_request] + +# This is the list of jobs that will be run concurrently. +# Since we use a build matrix, the actual number of jobs +# started depends on how many configurations the matrix +# will produce. +jobs: # This is the name of the job - can be whatever. test-matrix: @@ -34,38 +39,23 @@ on: # This is the list of steps this job will run. steps: - - name: arduino/arduino-lint-action - # You may pin to the exact commit or the version. - # uses: arduino/arduino-lint-action@e9a30879471dcbf7d9fe3481b26e60b652cca297 - uses: arduino/arduino-lint-action@v1.0.2 - with: - # Path containing Arduino projects. - path: # optional - # Version of the Arduino Lint tool to use. - version: # optional, default is 1.x - # How strict the checks are. - compliance: # optional, default is specification - # Configuration of the checks for libraries in the Arduino Library Manager index. - library-manager: # optional - # The type of project to check. - project-type: # optional, default is all - # Search path recursively for projects to check. - recursive: # optional, default is false - # Save a JSON formatted report on the checks to this file. - report-file: # optional - # Show more information on the checks being run. - verbose: # optional, default is false - # Run the checks that only apply to official (non 3rd party) Arduino projects. - official: # optional, default is false - # GitHub access token used to get information from the GitHub API. - token: # optional, default is ${{ github.token }} -- name: Setup Arduino CLI - # You may pin to the exact commit or the version. - # uses: arduino/setup-arduino-cli@28065f7e0317cc0dde372e0c11631963d743ee3b - uses: arduino/setup-arduino-cli@v1.1.2 - with: - # Version to use. Example: 0.5.0 - version: # optional, default is 0.x - # Personal access token (PAT) used to call the Github API. - token: # optional, default is ${{ github.token }} - + # First of all, we clone the repo using the `checkout` action. + - name: Checkout + uses: actions/checkout@v4 + + # We use the `arduino/setup-arduino-cli` action to install and + # configure the Arduino CLI on the system. + - name: Setup Arduino CLI + uses: arduino/setup-arduino-cli@v1 + + # We then install the platform, which one will be determined + # dynamically by the build matrix. + - name: Install platform + run: | + arduino-cli core update-index + arduino-cli core install ${{ matrix.arduino-platform }} + + # Finally, we compile the sketch, using the FQBN that was set + # in the build matrix. + - name: Compile Sketch + run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./blink